views:

47

answers:

1

I got some OSGi bundles in binary form that declare dependencies to bundles like "org.ietf.jgss" which are provided by Java itself. P2 detects these dependencies and when I try to install the product later using the P2 director application the installation fails since no bundle provides these packages. But if I use the P2 product build I get a complete installed product that I can use.

My problem is that I don't want to create product files and build for each variation of the application. So tried the approach to copy all P2 repositories in order to install the product on the target system using the P2 director.

So how do I handle dependencies to packages provided by Java and how to I "convince" P2 to ignore these packages if they are provided by Java itself.

Thanks for helping.

A: 

Packages provided by Java, or rather the "execution environment" as OSGi calls this, are by definition in a package starting with java.* and don't need explicit import statements.

If your virtual machine provides additional packages that don't start with java.* you can make them available through the system bundle (so the framework makes them available and explicit imports of these packages can be resolved), or use boot delegation (which means these packages will magically be available, even if not explicitly imported).

I'm a bit confused though by your first sentence. If a bundle declares a dependency on another bundle, how can this bundle be provided by Java itself, since the JVM does not provide any bundles?

Marcel Offermans