如何使用 Eclipse P2 处理 Java 提供的包

发布于 2024-08-23 05:45:08 字数 327 浏览 8 评论 0原文

我得到了一些二进制形式的 OSGi 包,它们声明了对 Java 本身提供的“org.ietf.jgss”等包的依赖关系。 P2 检测到这些依赖项,当我稍后尝试使用 P2 控制器应用程序安装该产品时,安装失败,因为没有捆绑包提供这些软件包。但如果我使用 P2 产品版本,我会得到一个可以使用的完整安装产品。

我的问题是我不想创建产品文件并针对应用程序的每个变体进行构建。因此尝试了复制所有 P2 存储库的方法,以便使用 P2 控制器在目标系统上安装产品。

那么,我如何处理对 Java 提供的包的依赖关系,以及如何“说服”P2 忽略这些包(如果它们是由 Java 本身提供的)。

谢谢你的帮助。

I got some OSGi bundles in binary form that declare dependencies to bundles like "org.ietf.jgss" which are provided by Java itself. P2 detects these dependencies and when I try to install the product later using the P2 director application the installation fails since no bundle provides these packages. But if I use the P2 product build I get a complete installed product that I can use.

My problem is that I don't want to create product files and build for each variation of the application. So tried the approach to copy all P2 repositories in order to install the product on the target system using the P2 director.

So how do I handle dependencies to packages provided by Java and how to I "convince" P2 to ignore these packages if they are provided by Java itself.

Thanks for helping.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟织青萝梦 2024-08-30 05:45:08

Java 提供的包,或者更确切地说,OSGi 所称的“执行环境”,根据定义位于以 java.* 开头的包中,不需要显式的 import 语句。

如果您的虚拟机提供了不以 java.* 开头的其他包,您可以通过系统捆绑包使它们可用(因此框架使它们可用,并且可以解析这些包的显式导入),或使用引导委托(这意味着即使没有显式导入,这些包也会神奇地可用)。

虽然你的第一句话我有点困惑。如果一个bundle声明了对另一个bundle的依赖,那么这个bundle如何由Java本身提供,因为JVM不提供任何bundle?

Packages provided by Java, or rather the "execution environment" as OSGi calls this, are by definition in a package starting with java.* and don't need explicit import statements.

If your virtual machine provides additional packages that don't start with java.* you can make them available through the system bundle (so the framework makes them available and explicit imports of these packages can be resolved), or use boot delegation (which means these packages will magically be available, even if not explicitly imported).

I'm a bit confused though by your first sentence. If a bundle declares a dependency on another bundle, how can this bundle be provided by Java itself, since the JVM does not provide any bundles?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文