简体   繁体   中英

OSGi (Karaf) maven dependencies resolution

I am creating a new Karaf feature that would contain several bundles (jclouds). I also have a maven "superproject" (jclouds-all) that contains all the modules/bundles I need.

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

A bundle needs to be a single artifact. So you have to list all the maven modules or bundles within the feature element. You cannot get Karaf to resolve a maven super project into artifacts and download them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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