I have some Maven modules that contain classes, but the JAR bundle artifacts they produce should not contain any of these classes - rather they should be limited including some data resources.
With the maven-bundle-plugin, I can exclude packages from the JAR by adding an exclude pattern to the Private-Package and Export-Package directives.
With the bnd-maven-plugin, it seems that this does not work. I also tries negative packages with -privatepackage and -includepackage, but that did also not have the desired effect.
Is it possible at all to tell the bnd-maven-plugin to exclude a particular package from the generated JAR?
I have been able to resolve my problem by not executing the bnd-jar goal. This restores the execution of the maven-jar-plugin. The only thing I had to still do then was to configure the maven-jar-plugin to pick up the MANIFEST.MF file created by bnd-process.
I have the impression that the Bnd Decorator in the Bnd Eclipse plugins triggers a jar:jar execution if the bnd-jar goal does not suppress it and that this somehow causes the endless loop.
Ok, here is the solution for this when using the jar goal.
The key is to disable the default behavior of the bnd plugin to include the classes folder and then use the correct syntax for -includeresources (which does not support ant-style wildcards, but still matches recursively) - so this works for including certain file types, but not matching certain directory paths.