extend war package imports in gemini container

146 views Asked by At

if i deploy a war-file into a gemini container (e.g. virgo has one) it will be transformed on-the-fly into an osgi bundle by adding some package imports (besides other things). Is it possible to somehow extend these default package imports using for example a bundle-listener or something like this? regards

1

There are 1 answers

5
Neil Bartlett On

I would strongly recommend that you do the transformation yourself before deploying into the Gemini container, rather than forcing Gemini to do the transformation on-the-fly. First it is very easy to do; second it will be much faster to deploy; third you will be able to add the specific imports that you want.

In order to turn a standard WAR file into a WAB (Web Application Bundle) that remains compatible with traditional WAR deployment, you just need to add the following headers to the MANIFEST.MF of the WAR:

  • Web-ContextPath to define the context path under which the web application will be served
  • Set Bundle-ClassPath to WEB-INF/classes plus any JARs under WEB-INF/lib. You will have to name these explicitly e.g.: Bundle-ClassPath: WEB-INF/classes,WEB-INF/lib/a.jar,WEB-INF/lib/b.jar...
  • Import-Package: javax.servlet,javax.servlet.http plus anything else you want to import.