Apache karaf how to easily install bundle from Maven repo
Solution 1
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.
Solution 2
Agree with @Antonio, for third party libraries which are not OSGi bundles you can also try to install them with wrap
:
bundle:install -s wrap:mvn:commons-httpclient/commons-httpclient/3.1
This will create a basic OSGi MANIFEST for the library...
You can find more info here: http://karaf.apache.org/manual/latest/developers-guide/creating-bundles.html
user3612643
Updated on June 27, 2022Comments
-
user3612643 almost 2 years
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!