简体   繁体   English

为OSGI容器创建一个Web应用程序包(WAB),该容器不包含maven-bundle-plugin的所有依赖项jar

[英]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). 我想在OSGI容器(如Karaf)上部署一个java webapp(带有web.xml和所有东西),以任何方式打包(war,jar,我不在乎)。 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 WEB-INF / lib必须为空,并且打包的webapp应该在容器上安装的其他bundle中查找所需的类
  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). bundle应该是一个webapp,因此容器知道它必须读取web.xml来运行它并通过已安装在容器上的HTTP服务(如jetty)使其可用(如在Karaf上)。
  3. it should be done with the maven-bundle-plugin 2.2.0 它应该使用maven-bundle-plugin 2.2.0来完成

I succed in making the bundles and deploying them automatically with that plugin and the maven-sling-plugin. 我成功地制作了捆绑包并使用该插件和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. 我想念的是将我的软件包打包为WAB的正确配置,我被告知这是一种正确的包装,没有依赖性。

Do you absolutely need a web.xml? 你绝对需要一个web.xml吗? I've recently gone through and updated a lot of webapps packaged as wars to convert them into pure bundles. 我最近经历过并更新了许多打包为战争的webapp,将它们转换为纯粹的捆绑包。 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). 您通常在web.XML中指定的大多数信息也可以在您的清单中指定,以便由pax web(karaf的前端到码头)获取。 Thus far I haven't run into a single war that couldn't be converted into a pure bundle (which would satisfy your constraints). 到目前为止,我还没有碰到一场无法转换成纯粹的战争(这将满足你的约束)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 maven-bundle-plugin 安装 OSGi 依赖项 - Installing OSGi dependencies with maven-bundle-plugin 这个“导入” maven-bundle-plugin OSGI警告是什么意思? - What does this “imported in” maven-bundle-plugin OSGI warning mean? maven-bundle-plugin嵌入依赖项无法将捆绑包部署到OSGi容器中 - maven-bundle-plugin embed dependency failed to deploy bundle into OSGi container 如何在NetBeans 7.4中创建Maven WAB(war as osgi bundle)项目? - How to create maven wab (war as osgi bundle) project in netbeans 7.4? 强制OSGi包由maven-bundle-plugin / BND导入 - Force OSGi package to be imported by maven-bundle-plugin / BND Glassfish,OSGi Web应用程序捆绑包(WAB)和虚拟服务器 - Glassfish, OSGi web application bundle (WAB) and virtual servers 使用maven-bundle-plugin包含Spring XML的依赖项 - Include dependencies from Spring XML using maven-bundle-plugin 有没有办法使用 maven-bundle-plugin 修改带有错误清单的 jar? - Is there a way to modify a jar with a wrong manifest using the maven-bundle-plugin? 如何使用Maven包插件在OSGi包中包含一罐依赖项? - How to include a jar of dependency in an OSGi bundle using maven bundle plugin? 使用Maven和maven-bundle-plugin在JAR清单中添加SVN修订时出错 - Error while adding SVN revision in JAR manifest with Maven and maven-bundle-plugin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM