On 30 April 2011 23:47, Yuri de Wit <[email protected]> wrote: > I have been going in circles trying to figure out why certain packages > weren't being exported until I noticed, after taking a look at the > sources, that the maven-bundle-plugin seems to be skipping .impl and > .internal packages.
That's correct - if you don't define any Export-Package then it defaults to the local non-internal / non-impl packages, as described in the "Default Behavior" section: http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html After I renamed my package to something else it > worked as expected. > > Is this restriction imposed by the OSGi specs? Although in theory > .impl means an internal package it is not always the case. Renaming > the package is an option, but seems a bit invasive (specially without > knowing a good reason for it to be the way it is). Last, is there a > simple work around for this beyond renaming the package? > There is nothing in the specs that restrict implementation packages from being exported, the bundleplugin defaults are based on user feedback and current best-practice. But they are only defaults - if you want to export internal packages then you can do so by explicitly setting Export-Package (or _exportcontents if you're exporting packages from embedded JARs, see the above link and FAQ for more details). Though ideally you wouldn't want to export implementation packages, since one benefit of modularity is that you can hide away internal / implementation details and instead communicate via interfaces and services. That way you get loose coupling, and substitutable bundles. > -- yuri > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > -- Cheers, Stuart

