OSGi: Having the same Package path in two differen

2019-05-06 23:24发布

问题:

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?

回答1:

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?