maven - 为什么不赞成使用maven-bundle-plugin的wrap/bundleall目标?

标签 maven osgi maven-bundle-plugin

http://svn.apache.org/repos/asf/felix/releases/maven-bundle-plugin-2.3.7/doc/site/wrap-mojo.html表示bundle:wrap已弃用,与bundle:bundleall相同。我目前使用wrap从非OSGi依赖项创建OSGi捆绑包,如http://www.lucamasini.net/Home/osgi-with-felix/creating-osgi-bundles-of-your-maven-dependencies所述。应该用什么代替它们?什么是弃用的原因是什么?

最佳答案

另一种选择是只使用bundle:bundle目标,然后在pom.xml中配置类似于以下内容的插件:

<plugin>
   <groupId>org.apache.felix</groupId>
   <artifactId>maven-bundle-plugin</artifactId>
   <configuration>
      <instructions>
         <Embed-Dependency>*;scope=compile;inline=true</Embed-Dependency>
         <_exportcontents>*</_exportcontents>
      </instructions>
   </configuration>
 </plugin>

您可以通过更改通配符“*”,范围等属性来控制嵌入和导出哪些依赖项。

关于maven - 为什么不赞成使用maven-bundle-plugin的wrap/bundleall目标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10103666/

相关文章:

java - 用于自动格式化代码以匹配 google checkstyle 的 Maven 插件?

java - IntelliJ IDEA : how to put maven dependency into correct location of builded artifact

maven-bundle-plugin - 包含资源指令的 Felix maven 捆绑插件问题

osgi - 如何处理来自 Bundle-Classpath 上的 jar 的 Import-Package 条目?

java - Maven 依赖项缺失 Artifact : jhotdraw

java - 在 Jenkins 中设置 java 自定义位置

java - 我正在尝试使用 Maven 创建 OSGI 包。我无法正确捆绑 JAR

java - 有关 ServiceEvent 和 BundleEvent 的 Felix 日志级别

java - 在线程运行时使用 OSGi 控制台

java - maven-bundle-plugin 创建意外的导入包内容