How to import the same package from different osgi packages?

In my osgi project, I have a maven-bundle-plugin with instructions for importing some path, for example: org.blah.blah. * And I have two other packages that export such a package. How to configure my package to import org.blah.blah. * Of both of them?

+7
source share
1 answer

You cannot import the specified package name from multiple packages. What you can do is Require-Bundle both packages, which will give your package access to both packages as a split package with all the inherent problems of split packages and Require-Bundle. See 3.13.3 in the OSGi Core Release 5 specification.

It would be better to refactor (if possible) to avoid split packets.

+10
source

All Articles