将OSGI DS组件反向移植到OSGI R4 [英] Backporting OSGI DS component to OSGI R4
问题描述
我有一个为Apache Karaf 4.0.5开发的组件.但是,事实证明,它需要部署在基于较旧版本的Felix的glassfish 4上.我在尝试部署它时收到此消息:
I have a component which was developed for Apache Karaf 4.0.5. However, it turns out it needs to be deployed on glassfish 4, which is based on an older version of Felix. I get this message when trying to deploy it:
missing requirement [319.0] osgi.extender; (&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))
但是,我的pom文件未显示对osgi.component的任何显式依赖.我想我一定已经使用了某些OSGI R5(或R6?)特定功能,但是我不知道哪个会导致此错误.
However, my pom file does not show any explicit dependency on osgi.component. I think I must have used some OSGI R5 (or R6?) specific feature, but I don't know which would cause this error.
我该如何说服glassfish接受我的捆绑软件,或者更改捆绑软件的build/pom,以便在尝试使用依赖于R5或更高版本的OSGI功能时收到警告?
How can I either convince glassfish to accept my bundle, or change the bundle's build / pom so that I get warnings when trying to use OSGI features dependent on R5 or later?
推荐答案
您可能正在使用最新版本的bnd生成捆绑包及其元数据.当您的捆绑包具有DS组件,并且您需要DS 1.3中的新功能(例如字段注入),或者您使用的是最新版本的bnd时,Bnd就会在osgi.component扩展器(这是DS)上生成需求.
You are probably using a recent version of bnd to generate your bundle and its metadata. Bnd will generate the requirement on the osgi.component extender (This is DS) when your bundle has DS components and either you require something new in DS 1.3 like field injection or you are using the very latest version of bnd.
您可以使用bnd指令禁用捆绑软件中需求的生成:
You can disable the generation of the requirement in your bundle with the bnd instruction:
-dsannotations-options: norequirements
这篇关于将OSGI DS组件反向移植到OSGI R4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!