Reputation: 3955
I am new to Java OSGi programming. I am creating a new bundle called com.myManager and adding it to an existing application which has many bundles.
This bundle I am creating depends on an external jar file called jsoup-1.12.1 which is used for parsing html files. I can add this dependency via eclipse, and my bundle builds fine.
However, when I try to add my bundle to the main bndrun application, I get the below pasted error. Unfortunately i'm not able to understand what is required here.
I guess that we can't just simply add external jar files the way I did? Thanks in advance.
Resolution failed. Capabilities satisfying the following requirements could not be found:
[<<INITIAL>>]
⇒ osgi.identity: (osgi.identity=com.myManager)
⇒ [com.myManager version=0.0.0]
⇒ osgi.wiring.package: (&(osgi.wiring.package=org.jsoup))
Upvotes: 1
Views: 388
Reputation: 19606
Until now you only added jsoup to the build time dependencies of your bundle. Using jsoup in your bundle then creates a import package declaration in your bundle manifest. This is expected and not a problem. The error you see is that at assembly time (when bnd creates the runbundles list) of your application you have no bundle in the repository that can provide this package.
Jsoup already is an OSGi bundle. Simply add it to the bundles of your application and you are done. How to add jsoup to the bundles depends on how you assemble your application. For eclipse pde you would add it to the target platform. For apache karaf you would add it to your feature.
For the new bndrun with the maven build you simply add jsoup to the pom where you build your repository. Like in this example. Having the bundle in the repository allows bndtools to select the bundle for your application if there is a requirement for it.
Upvotes: 3