【OSGi】Require-Bundle与Import-Package

Require-Bundle虽然能实现整个bundle的依赖,但存在诸多问题:无法明确导入包、导出bundle重构影响导入bundle及可能导致导入大量无用包。相比而言,Import-Package提供更细粒度的控制,推荐使用。引入Require-Bundle主要是为了解决Eclipse等历史遗留的全模块依赖问题。
摘要由CSDN通过智能技术生成

Require-Bundle的作用

Another kind of constraint that can be placed on a bundle is the Require-Bundle header. This is similar to Import-Package header in that it makes exported packages from another bundle available to our bundle, but it works on the whole bundle rather than individual packages.

Bundle B has a Require-Bundle dependency on Bundle A, meaning that Bundle B cannot resolve unless Bundle A is in RESOLVED state. The effect at runtime is as if Bundle B had declared an Import-Package header naming every package exported by Bundle A.

However, Bundle B is giving

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值