felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart McCulloch <mccu...@gmail.com>
Subject Re: maven-bundle-plugin and .impl and .internal packages
Date Sun, 01 May 2011 11:52:23 GMT
On 30 April 2011 23:47, Yuri de Wit <ydewit@gmail.com> 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:


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: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org

Cheers, Stuart

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message