Create a web application package (WAB) for an OSGI container that does NOT contain a jar of all dependencies with the maven-bundle-plugin

I want to deploy java webapp (with web.xml and that's it), packaged in some way (war, jar, I don't care) in an OSGI container (like Karaf). There are two important limitations:

  • WEB-INF / lib should be empty, and packaged webapp should look for the necessary classes in other packages installed in the container
  • the package should be webapp, so the container knows that it needed to read web.xml to run it and make it available through an HTTP service (for example, a pier), which is already installed on the container (for example, on Karaf),
  • this should be done using maven-bundle-plugin 2.2.0

I managed to create packages and deploy them automatically using this plugin and the maven-sling-plugin plugin. What I missed is the correct configuration for packing my package as a WAB, that I was told that it is the right kind of packaging for this and without dependencies.

+4
source share
1 answer

Do you absolutely need web.xml? I recently looked through and updated many webapps packaged as wars to convert them to clean packages. Most of the information that you usually provide in web.XML can also be provided in your manifest to be picked up via the pap website (karaf frontend to jetty). Until now, I have not encountered one war that could not be transformed into a clean bunch (to satisfy your limitations).

+1
source

All Articles