Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSGi - How mature is this technology?

I have a requirement where I need to share some web resources (jsp, html, js, images, css etc.) across different Spring based Struts 2 applications. And seems like OSGi can be used to achieve this?

  • Can some one give some pointers on how to achieve this with OSGi?
  • And secondly I want to know is OSGi mature enough to be used in production applications?

Thanks in advance!

EDIT: I went through this post and seems like people are able to share a web bundle across web applications. The only difference is that they did it with Spring MVC. I want to know whether this can be achieved with Struts2 applications also?

EDIT 2: I am basically little unclear about the following:

  • Will the 'shareable-bundle' (containing the web resources to be shared) be a .war packaged. If yes, then from where will the final web context be formed since this bundle is again to be shared with the main 'web' application? I am expecting the final web context to be formed out of the merging of the 'shareable-bundle' and the 'main' web application. Will it happen automatically? Any ideas?
like image 477
peakit Avatar asked Dec 02 '09 16:12

peakit


1 Answers

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:

  • Cut and paste them.
  • Use Assembly and Dependency plugins
  • Use the maven-remote-resources-plugin

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.

like image 54
Pascal Thivent Avatar answered Nov 03 '22 02:11

Pascal Thivent