Question

1) Bundle A reexports package com.X, which it gets from bundle C


2) Bundle B exports package com.X


3) Now bunlde D has dependency on both A and B.


From where will the bundle D get the package com.X from?

Was it helpful?

Solution

The first question is why you have 2 bundles defining the same package - this is called split packages and isn't recommended because you can have problems with shadowing.

With Import-Package the runtime will pick either bundle A or B to resolve the package dependency and you can't control this directly (you can do various tricks like the Eclipse guys do by setting mandatory properties on the exports).

With Require-Bundle you'll end up with a merged com.X package, so you'll see the superset of types, but I'm not sure what happens if you have overlapping types.

The simplest thing is to avoid split packages in the first place.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top