简体   繁体   English

OSGi(Karaf)Maven依赖项解析

[英]OSGi (Karaf) maven dependencies resolution

I am creating a new Karaf feature that would contain several bundles (jclouds). 我正在创建一个新的Karaf功能,其中将包含多个捆绑软件(jclouds)。 I also have a maven "superproject" (jclouds-all) that contains all the modules/bundles I need. 我也有一个maven“超级项目”(jclouds-all),其中包含我需要的所有模块/捆绑软件。

Is it possible, when defining the feature, to specify just the one superproject's bundle and have all the concrete bundles resolved automatically or do I need to list all the bundles in my feature? 定义功能时,是否可以仅指定一个超级项目的包并自动解决所有具体的包,还是需要列出功能中的所有包?

I tried it: 我尝试过这个:

<feature name="my-cloud" version="${project.osgi.version}" resolver="(obr)">
    <bundle start-level="${core.startlevel}" dependency="true">mvn:org.apache.jclouds/jclouds-all/1.6.2-incubating</bundle>
</feature>

and it complains: 它抱怨:

java.lang.IllegalArgumentException: Unable to build OBR representation for bundle mvn:org.apache.jclouds/jclouds-all/1.6.2-incubating java.lang.IllegalArgumentException:无法为捆绑包mvn:org.apache.jclouds / jclouds-all / 1.6.2-incubating建立OBR表示形式

A bundle needs to be a single artifact. 捆绑包必须是单个工件。 So you have to list all the maven modules or bundles within the feature element. 因此,您必须列出Feature元素内的所有Maven模块或包。 You cannot get Karaf to resolve a maven super project into artifacts and download them. 您无法让Karaf将Maven超级项目解析为工件并下载它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM