为什么不赞成使用maven-bundle-plugin的wrap/bundleall目标? [英] Why (and in favor of what) are maven-bundle-plugin's wrap/bundleall goals deprecated?
问题描述
http://www.lucamasini.net/Home/osgi-with-felix/creating-osgi-bundles-of-your-maven-dependencies .应该用什么代替它们?什么是弃用的原因?
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屋!