OSGi - How mature is this technology? OSGi - How mature is this technology? spring spring

OSGi - How mature is this technology?


While OSGI might be a solution, it might be a bit overkill (and, as Bozho pointed out, you'll need an OSGI capable container). Maybe have a look at How to share resources across projects in Maven for other options:

In this blog I’ll show how to do the second option since in my opinion, it is currently the most stable and flexible. In the future, I’ll try out the maven-remote-resources-plugin and write up a tutorial.

EDIT: To answer a comment from the OP. Yes, the idea it to create an assembly of the shareable web resources and to use the maven-dependency-plugin to pull and unpack the assembly in the "resource-consumer" projects. All this is explained and detailed in the blog post mentioned above. Let me know if anything is unclear in it.


OSGi is used in Eclipse, GlassFish, ServiceMix (and others, too), which are mature software products. However, they are very specific in nature, and my personal opinion is, that OSGi is not quite suitable for the common type projects. As far as I know (someone correct me, if there is news in this area), if you want to use OSGi with web applications, you will need an OSGi bundled servlet container. Also, putting resources (html, js, images) in OSGi bundles can be troublesome.


OSGi is a fairly mature technology - this is how all Eclipse plugins are structured. However, the technology has yet to gain traction in the web app space because there are very few servlet containers that support it.

If you want to read up on it, you should check out Modular Java by Craig Wells, as it gives a fairly good background on OSGi in relation to the Spring Framework.

With regard to sharing resources, you may want to look into an EAR package. I have successfully used this to deploy multiple WAR files with a common set of resources (for example, a compressed version of Dojo).

For example, an EAR can look like:

 ear-file/proj1 ear-file/proj2 ear-file/config ear-file/lib ear-file/resources ear-file/META-INF ear-file/APP-INF

You may also want to read up on the thread .war vs .ear file from a previous stackoverflow post.