让maven生成Required-Bundles Header?
我想让 maven 根据 pom.xml
中指定的依赖项创建标头字段 Require-Bundle
。 我研究了 maven-jar-plugin,但它只支持 ClassPath 标头的生成。
有谁知道一个 Maven 插件,可以根据我的 pom 依赖项的范围 provided
自动生成清单中的 RequireBundle
条目?
此致
I want to let maven to create the header field Require-Bundle
depending on my dependencies specified in the pom.xml
.
I looked into the maven-jar-plugin
but it does only support generation of the ClassPath header.
Does anyone know a maven plugin that can automatically generate the RequireBundle
entry in the manifest out of my pom dependencies of scope provided
?
Best regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该使用 maven-bundle-plugin 。
附录:
更准确地说,maven-bundle-plugin 只会在定义包的依赖项时为您提供帮助。它不会自动构建一组所需的捆绑包。这是因为需要捆绑包不是推荐的 OSGi 实践:您应该依赖导出的包。因此,maven-bundle-plugin 会自动填充 Import-Package,但不会对 Require-Bundle 执行相同的操作(无论如何,无论是其中一个还是另一个)。因此,如果您选择走这条路,无论如何您都必须手动指定捆绑包。
这不算是解决方案,但我认为值得讨论。
You should use the maven-bundle-plugin.
ADDENDUM:
More precisely, maven-bundle-plugin would only assist you when defining the dependencies of your bundle. It would not automatically construct a set of required bundles. This is because requiring bundles is not the recommended OSGi practice: you should depend on exported packages. For this reason, maven-bundle-plugin automatically fills the Import-Package, but would not do the same for Require-Bundle (either one or the another, anyway). Hence if you choose to take this road, you'll have to specify bundles manually anyway.
This does not count as a solution, but I thought it worth of discussion.