开发者

Create a Web Application Bundle (WAB) for a OSGI container that does NOT contain jar of all dependencies with maven-bundle-plugin

I want to deploy a java webapp (with web.xml and everything), packaged in any way (war, jar, I do not care) on an OSGI container (like Karaf). There are two important constraints:

  1. the WEB-INF/lib must empty, and the packaged webapp should look for the needed classes in other bundles installed on the container
  2. the bundle should be a webapp, so the container knows that it had to read the web.xml to run it and make it available through the HTTP service (like jetty) that is already installed on the container (like on Karaf).
  3. it should be done with the maven-bundle-plu开发者_StackOverflow中文版gin 2.2.0

I succed in making the bundles and deploying them automatically with that plugin and the maven-sling-plugin. What I miss is the correct configuration to package my bundle as a WAB , that I've been told being the right kind of packaging for this, and without dependencies.


Do you absolutely need a web.xml? I've recently gone through and updated a lot of webapps packaged as wars to convert them into pure bundles. Most of the information that you normally specify in a web.XML can also be specified in your manifest to be picked up by pax web (karaf's frontend to jetty). Thus far I haven't run into a single war that couldn't be converted into a pure bundle (which would satisfy your constraints).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜