What about using properties instead of rewriting the whole
configuraiton for the plugin for each bundle ?
So instead of having:
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Import-Package>
org.osgi.framework;version="1.5",
org.osgi.service.cm;version="[1.2.0,2.0.0)",
*
</Import-Package>
<Export-Package>
org.apache.aries.transaction.exception*
</Export-Package>
<Private-Package>
org.apache.aries.transaction*
</Private-Package>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
The module above would simply override a few properties:
<properties>
<aries.osgi.import>
org.osgi.framework;version="1.5",
org.osgi.service.cm;version="[1.2.0,2.0.0)",
*
</aries.osgi.import>
<aries.osgi.export>
org.apache.aries.transaction.exception*
</aries.osgi.export>
<aries.osgi.private>
org.apache.aries.transaction*
</aries.osgi.export>
</properties>
This doesn't look like it brings much, but the real benefit is that
you can leave default values untouched.
For example, we can define default values for the osgi range version
policy for imported packages, for the symbolic name, version, etc. ...
This means that for simple bundles, you can only define the minimum
set of proeprties sufficient to generate a nice bundle.
Thoughts ?
P.S.: a real example can be found for Camel:
http://svn.apache.org/repos/asf/camel/trunk/
But there are a lot of other projects doing that.
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com