如何配置maven-bundle-plugin以排除Import-Service和Export-Service? [英] How to configure maven-bundle-plugin to exclude Import-Service and Export-Service?
问题描述
我使用maven-bundle-plugin创建OSGi兼容罐.它会生成预期的OSGi清单,但Import-Service和Export-Service除外.
I use maven-bundle-plugin to create OSGi compliance jars. It generates expected OSGi MANIFEST, except Import-Service and Export-Service.
根据 http://wiki.osgi.org/wiki/Import-Service,不建议使用Import-Service.难怪我无法以分布式结构模式(集群)启动使用者捆绑包.捆绑软件的清单中包含Import-Service条目,该条目使它等待(宽限期).当我手动删除该条目时,它开始完美.
According to http://wiki.osgi.org/wiki/Import-Service, using Import-Service is deprecated. No wonder I failed to start a consumer bundle in distributed fabric mode (cluster). The bundle's MANIFEST contains Import-Service entry which causes it to wait (grace period). It started perfectly as I remove that entry manually.
那么,如何配置maven-bundle-plugin从其生成的JAR中排除Import-Service和Export-Service?如果必须手动删除条目,这真的很麻烦.
So, how to configure maven-bundle-plugin to exclude Import-Service and Export-Service from it's generated JARs? It's really troublesome if I have to remove the entry manually.
谢谢
推荐答案
可以为插件配置添加内部说明元素:
Inside instructions element for plugin configuration you may add:
<_removeheaders>Import-Service,Export-Service</_removeheaders>
这等效于bnd中的-removehaders标志.
This is equivalent of -removehaders flag in bnd.
这篇关于如何配置maven-bundle-plugin以排除Import-Service和Export-Service?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!