管理 OSGi 包依赖关系的正确步骤是什么?

发布于 2024-12-06 23:58:15 字数 737 浏览 1 评论 0原文

我即将开始开发一个我想在 OSGi 容器中运行的应用程序,例如 Virgo。 Virgo 的核心平台提供了许多我感兴趣的依赖项,例如 Spring 框架,但我也想使用 Spring Integration。 Spring Integration 的 jar 是现成的 OSGi 包,我可以在 Ivy 存储库中与许多其他第三方依赖项一起使用。

为了告诉 OSGi 容器我的包依赖于 Spring Integration,我需要将相关的包或包添加到我的清单中 —— 我知道如何执行此操作并了解其工作原理。

我想了解的是如何开发、解析、构建和最终部署某种存储库(最好是 Ivy)中可用的第三方捆绑包。过去,我通过两种方式完成此任务:

  1. 将依赖项添加到目标平台,或者在本例中为 Virgo ext 存储库
  2. 在我的工作区中保留依赖项的副本,将其作为构建的一部分导出

这些解决方案都不是看起来可扩展或特别优雅。

我有兴趣使用 Virgo 3.0.0 或 Equinox,并且我的开发环境是 Eclipse,如果不同的 OSGi 容器或开发环境能让我的生活更轻松,我很乐意切换。

为了清楚地说明这一点,我想知道:

  1. 如何针对外部存储库中的 OSGi 捆绑包(例如 Ivy 中的捆绑包)进行开发?
  2. 如何构建和部署我的捆绑包及其所需的外部依赖项?

I'm about to start working on an application that I'd like to run in an OSGi container, like Virgo. Virgo's core platform supplies many of the dependencies I'm interested in, like the Spring Framework, but I'd also like to use Spring Integration. Spring Integration's jars are ready-to-go OSGi bundles, and are available to me along with many other third-party dependencies in an Ivy repository.

To tell the OSGi container that my bundle depends on, say, Spring Integration, I need to add relevant packages or bundles to my Manifest -- I know how to do this and understand how that works.

What I'd like to understand is how to develop against, resolve, build and eventually deploy third-party bundles available in some kind of repository (preferably Ivy). In the past I've accomplished this in two ways:

  1. Add the dependencies to the target platform, or in this case, the Virgo ext repository
  2. Keep a copy of the dependency in my workspace, export it as part of the build

Neither of these solutions seem scalable or especially elegant.

I'm interested in using Virgo 3.0.0 or Equinox and my development environment is Eclipse, if a different OSGi container or development environment will make my life easier, I'm happy to switch.

To make this crystal clear, I'd like to know:

  1. How do I develop against OSGi bundles in an external repository (e.g. the bundles live in Ivy)?
  2. How do I build and deploy my bundle along with its required external dependencies?

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

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

发布评论

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

评论(2

著墨染雨君画夕 2024-12-13 23:58:15

您可以定义一个外部 Virgo 存储库以指向 Ivy 存储库的本地副本,如《Virgo 用户指南》中“配置本地配置存储库”下所述。从 Eclipse 启动 Virgo 时也可以使用此存储库。

请注意,我们正在致力于 Virgo 3.5 的 p2 集成,这将为您提供一些进一步的选择。

You can define an external Virgo repository to point at a local copy of an Ivy repo as explained in the Virgo User Guide under "Configuring the Local Provisioning Repository". This repository can also be used when Virgo is launched from Eclipse.

Note that we are working on p2 integration for Virgo 3.5 and this will give you some further options.

痴梦一场 2024-12-13 23:58:15

AFAIK 这是特定于实现的。如果您使用的是 Equinox,那么 p2 就是您正在寻找的配置系统。我假设其他实现会有自己的方法/工具来完成类似的功能。

AFAIK that is implementation specific. If you are using Equinox, then p2 is the provisioning system you are looking for. I would assume that other implementations would have their own methods/tools for accomplishing similar functionality.

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