There is an alternative way to define the bnd instructions with less xml clutter:
Configure the plugin like this:
<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 the instructions, e.g.
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: *
Remark: There is a minus sign in the _include tag before the filename!
A real life example can be found here:
pom.xml file and osgi.bnd file.