OSGI - 处理捆绑包所需的第三方JAR [英] OSGI - handling 3rd party JARs required by a bundle

查看:138
本文介绍了OSGI - 处理捆绑包所需的第三方JAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用OSGI,并且很难理解如何最好地处理依赖的JAR。

I'm just getting started with OSGI development and am struggling to understand how best to handle dependant JARs.

即。如果我正在创建一个捆绑包,我可能需要使用一些第三方JAR。当我创建我的捆绑JAR以部署到OSGI时,显然这些第三方JAR不包括在内,因此捆绑包不会运行。

i.e. if I'm creating a bundle the likelyhood is that I will need to use a few 3rd party JARs. When I create my bundle JAR to deploy to OSGI, obviously these 3rd party JARs are not included and thus the bundle will not run.

我明白一个选项是转向这些JAR成为捆绑包,并将它们部署到OSGI容器中。但是,如果它们只需要被一个捆绑使用,那么这似乎并不理想。

I understand that one option is to turn these JARs into bundles and also deploy them to the OSGI container. However if they only need to be used by the one bundle this doesn't seem ideal.

对此最好的解决办法是什么? JAR是否可以嵌入到捆绑JAR中,如果是这样,这是一种合理的方法吗?

What is the best solution to this? Can the JARs be embedded within the bundle JAR and if so is this a reasonable approach?

推荐答案

我几乎总是捆绑每个jar分别。 OSGi本身就是用于模块化的,你可以通过不这样做来使整个系统变得荒谬。

I would almost always bundle each jar separately. OSGi itself is meant for modularization and you take the whole system ad absurdum by not doing this.

如果你想将JAR转换为包,你可能想要使用由Peter Kriens撰写的BND工具。但首先我建议你在 SpringSource Enterprise Bundle Repository 中寻找捆绑包还没有完成你的工作。

If you want to convert JARs into bundles you might want to use the BND Tool written by Peter Kriens. But first I would suggest you look for the bundle in the SpringSource Enterprise Bundle Repository if they haven't already done the work for you.

这篇关于OSGI - 处理捆绑包所需的第三方JAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆