Is there a way to deploy exploded bundles in Apach

2019-07-24 17:34发布

We are looking at rearchitecting our web application and want to move to a more modular solution, OSGi seems to meet a lot of our needs.

I've come across the Apache Felix project and taken it for a spin. It looks solid yet I find the development cycle a bit slow as it requires a maven build of the bundle(s) to make any code changes effective.

Instead I would like to be able to reload a bundle once classes have been compiled by Eclipse, without any extra building/packaging. Similar to how Tomcat and other servlet containers support deployment of "exploded" war files.

Is this possible to do with Felix or any other OSGi container?

2条回答
兄弟一词,经得起流年.
2楼-- · 2019-07-24 18:18

In the Gogo shell, you can do:

install reference:file:/path/to/exploded/directory

This will install an exploded bundle. The format of the exploded directory should be exact that of a bundle JAR file.

查看更多
淡お忘
3楼-- · 2019-07-24 18:27

Apache Felix FileInstall supports exploded bundles out of the box. Just install it, and put a directory with your bundle in the load directory (or configure FileInstall to look somewhere else).

Not exactly answering your question, but if you have issues with the build cycle, you should take a look at bndtools, which is a plugin for Eclipse that a.o. automatically builds and deploys your bundles in a running framework when your code changes.

查看更多
登录 后发表回答