Search code examples
javaosgibundleapache-felix

OSGi: Having the same Package path in two different Bundles


I got a bundle1 that has the following packages:

com.anderson.servlet.osgi (exported) 
com.anderson.servlet
com.anderson.util (exported)

and a second one, bundle2, that looks like this:

com.anderson.jetty
com.anderson.servlet.osgi 

and I also import com.anderson.servlet.osgi from bundle1.

Is it possible to merge both packages in bundle2?


Solution

  • No. If you import a package, that takes precedence over a private package with the same name that you may happen to have inside your bundle.

    Why not just rename the private package in bundle2?