Why (and in favor of what) are maven-bundle-plugin

2019-02-12 15:38发布

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?

2条回答
SAY GOODBYE
2楼-- · 2019-02-12 16:20

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.

查看更多
虎瘦雄心在
3楼-- · 2019-02-12 16:37

I've wondered the same question, found some clue here:

http://www.mail-archive.com/dev@felix.apache.org/msg22221.html

"Instead new features/goals will be added to solve common use-cases such as creating mega-bundles, etc."

I guess they're going to rework the current goals because the current codebase doesn't support all that they want to implement in the plugin.

查看更多
登录 后发表回答