Eclipse/Equinox:启动所有已安装的插件?
我有一个使用功能构建的 Eclipse 产品。所有服务都是通过声明性服务注册的。据我了解,必须启动捆绑包,服务组件运行时才能拾取并注册每个捆绑包中公开的服务。
我想自动启动 OSGi 运行时中安装的每个包。有没有一种简单的方法可以做到这一点?我唯一能找到的是产品>配置>起始级别>自动启动选项。我不想在我拥有的每个产品构建中都这样做,因为我想将功能转移到分组和功能上。一起启动类似的捆绑包。
有没有简单/推荐的方法来做到这一点?
I have an Eclipse product build using features. All of the services are registered via Declarative Services. As I understand it, the bundle must be started for the Service Component Runtime to pick up and then register the services exposed in each bundle.
I want to automatically start every bundle that's installed in my OSGi runtime. Is there a simple way to do this? The only thing I can find is the Product > Configuration > Start Levels > Auto-Start option. I don't want to have to do this in every product build that I have since I wanted to move to features to group & to start similar bundles together.
Is there a simple/recommended way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为堆栈溢出问题/答案[1],全面讨论了您的需求。
否则,如果您使用的是支持 p2 的产品,则可以在您的 bundles.info 文件中将默认启动参数设置为“true”。但这是一种 hacky 方式。
[1] 在 Equinox 中,是否可以将 OSGi 包标记为从其包含功能的 p2.inf 开始?
I think the stack overflow question/answer[1], comprehensively discuss your requirement.
or else if you are using a p2-enabled product, you can set the start-by-default param to 'true' within your bundles.info file. But that is a hacky way.
[1] In Equinox Is it possible to to mark an OSGi bundle as started from its containing feature's p2.inf?
从
MANIFEST.MF
中删除Bundle-ActivationPolicy:lazy
并确保属性enabled="false"
不在你的组件定义中!Remove
Bundle-ActivationPolicy: lazy
from yourMANIFEST.MF
and make sure that the attributeenabled="false"
is not in your component definition!