Stuart McCulloch wrote:
On 08/08/07, Stefano Lenzi <[EMAIL PROTECTED]> wrote:
Hi All,

I would like to speak about the maven-bundle-plugin.

Q.1 - There is a way to say to the plugin to ignore some packages?


Yes - you can add negative instructions to both Import-Package and
Export-Package, to override the automatic processing, for example:

    <Import-Package>!foo.bar, *</Import-Package>

would avoid importing the foo.bar package, even if it was required.

Basically, any directives you can give to BND can be used with the
bundle-plugin - for a good overview of the directives, please read:

    http://aqute.biz/Code/Bnd

the thing to remember is the "pull-approach"... the BND tool uses
Export-Package, Private-Package and Include-Resource to decide
the contents of the bundle - it then analyzes the contents to find
referred packages and applies the Import-Package rules.

I've read the documentation and it looks that there is no way to avoid BND do add classes that are in packages that you import but that you never use. For example: A class inside a Bundle import uses the class a.b.Foo, and it use the BND directive private-package in order to include such class in the bundle classes. The package a.b contains also the classes: a.b.Muo, a.b.Gal, so BND will add to the bundle all a.b.XXX classes even if they are never referenced.

So my question is: do you think that a class filter should be added to maven-bundle-plugin or the bundle developer should achieve that in other ways?


I.1 - If there is no way to inform the plugin ignore some packages I
think would be very useful; because if (like in my case) a bundle
depends on a library that contains "too much code" there is no way to
avoid to satisfy all the "package requirement" by using the plugin. More
in general I think would be nice to improve the plugin in order to have
a class grain level  source(binary) code inspection.

Ciao,
Stefano "Kismet" Lenzi





Reply via email to