You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Clay McCoy <cm...@claymccoy.com> on 2011/01/12 17:38:44 UTC

Use case of the felix bundle plugin with Embed dependencies

Apparently RCP/OSGI does not handle transitive dependencies.  Not to mention
that depending on a plain jar (which the rest of the java world uses) is
tricky.
This is why I am attempting to use the maven bundle plugin with Embed
dependencies.  Here is my use case, my question is if I am even headed in
the right direction conceptually.

Here is the dependency chain:
Manifest1stBundleTests -> Manifest1stBundle -> Pom1stBundle ->
google.guava.jar

The Pom1stBundle is built with the maven bundle plugin.  I found a guava
bundle and used it instead of the jar, and added an instruction in
the Pom1stBundle pom to require the guava bundle.  Both the Pom1stBundle and
the guava bundle are put in a p2 repo, and the p2 repo is referenced in the
target platform of the Manifest1stBundle's project.  Since each bundle above
requires the next, I would expect to be able to run
the Manifest1stBundleTests, but I get a class not found exception about
guava.  To pass the junit tests I have to either pull Pom1stBundle into the
Eclipse workspace, or have Manifest1stBundle require the guava bundle
directly.  I would have expected the guava bundle to be pulled out of the p2
repo transitively just because Manifest1stBundle requires Pom1stBundle which
requires the guava bundle.  Is that not the expected behavior?

So I turn back to the familiar and sane Maven world since OSGI transitive
dependencies don't seem to work, and I'd rather not be finding/creating
bundles made from jars.  Then my idea is just to use Embed dependencies so
that the actual guava.jar specified in the pom is inside the Pom1stBundle
(as well as everything else that it needs.  In theory I will have a self
contained bundle that is consumable by other bundles, and has reasonable
dependency management.

Is this conceptually sound and a valid way to use the maven bundle plugin?
 Suggestions?