There is an alternative way to define bnd commands with less xml clutter:
Configure the plugin as follows:
<plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <_include>-osgi.bnd</_include> </instructions> </configuration> </plugin>
and provide a file (here: osgi.bnd) with instructions, for example.
Import-Package: !javax.servlet,\ !org.apache.avalon.framework.logger,\ org.apache.commons.collections;version="[1.0,2)",\ org.apache.commons.collections.comparators;version="[1.0,2)",\ org.apache.commons.collections.keyvalue;version="[1.0,2)",\ org.apache.commons.collections.list;version="[1.0,2)",\ org.apache.commons.collections.set;version="[1.0,2)",\ !org.apache.log,\ !org.apache.log4j,\ * Export-Package: *
Note: there is a minus sign in the _include tag before the file name!
An example of real life can be found here:
pom.xml file and osgi.bnd file .
source share