Equinox 捆绑包导入冲突
1) 捆绑包 A 重新导出 包 com.X,它是从捆绑包 C 获取的
2) 捆绑包 B 导出包 com.X
3) 现在捆绑包 D 依赖于 A 和 B。
捆绑包将从哪里获取D 从哪里获取 com.X 包?
1) Bundle A reexports package com.X, which it gets from bundle C
2) Bundle B exports package com.X
3) Now bunlde D has dependency on both A and B.
From where will the bundle D get the package com.X from?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一个问题是为什么你有 2 个包定义相同的包 - 这称为分割包,不推荐,因为你可能会遇到阴影问题。
使用
Import-Package
,运行时将选择包 A 或 B 来解决包依赖性,并且您无法直接控制它(您可以像 Eclipse 人员一样通过在包上设置强制属性来执行各种技巧)出口)。使用
Require-Bundle
你最终会得到一个合并的com.X
包,所以你会看到类型的超集,但我不确定如果你有重叠的类型。最简单的事情就是首先避免拆分包。
The first question is why you have 2 bundles defining the same package - this is called split packages and isn't recommended because you can have problems with shadowing.
With
Import-Package
the runtime will pick either bundle A or B to resolve the package dependency and you can't control this directly (you can do various tricks like the Eclipse guys do by setting mandatory properties on the exports).With
Require-Bundle
you'll end up with a mergedcom.X
package, so you'll see the superset of types, but I'm not sure what happens if you have overlapping types.The simplest thing is to avoid split packages in the first place.