为什么不赞成使用maven-bundle-plugin的wrap/bundleall目标? [英] Why (and in favor of what) are maven-bundle-plugin's wrap/bundleall goals deprecated?

查看:168
本文介绍了为什么不赞成使用maven-bundle-plugin的wrap/bundleall目标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://svn.apache.org/repos/asf/felix/releases/maven-bundle-plugin-2.3.7/doc/site/wrap-mojo.html says bundle:wrap is deprecated, same with bundle:bundleall. I currently use wrap to create an OSGi bundle from a non-OSGi dependency, as described at http://www.lucamasini.net/Home/osgi-with-felix/creating-osgi-bundles-of-your-maven-dependencies. What should they be replaced by and what's the reason for the deprecation?

推荐答案

替代方法是只使用bundle:bundle目标,然后在pom.xml中配置类似于以下内容的插件:

The alternative is to just use the bundle:bundle goal, then in your pom.xml configure the plugin similar to the following:

<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>

您可以通过更改通配符"*",作用域等属性来控制嵌入和导出哪些依赖项.

You can control what dependencies get embeded and exported by changing the wildcards "*", scope, etc. attributes.

这篇关于为什么不赞成使用maven-bundle-plugin的wrap/bundleall目标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆