Apache karaf how to easily install bundle from Maven repo

user3612643 picture user3612643 · Sep 9, 2015 · Viewed 15.5k times · Source

I am trying out Karaf and installed some bundle X. This bundle X complains about a missing requirement: Unresolved requirements ... osgi.wiring.package; (osgi.wiring.package=org.apache.commons.httpclient)]

Hence, I tried to provide the org.apache.commons.httpclient through bundle:install mvn:commons-httpclient/commons-httpclient/3.1 which worked.

But, after trying to start the X again, I still get the same error message.

thanks!

Answer

That jar is not a bundle, hence can't be deployed to karaf, it's just ignored.

Try

karaf@root>bundle:install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient/3.1_7

Make it sure that your bundle has in their META-INF/MANIFEST.MF the osgi import declarations syntax. I assume that you use bndtools to generate the bundle.