Yesterday I committed a larger change in the Aries JPA modules regarding
the maven setup.
I always had problems with the defaults the Aries parent sets for the
maven bundle plugin.
In the ops4j pax projects I have seen a different style of configuring
the maven bundle plugins that I think is much more straight forward.
They use an external osgi.bnd file that contains the settings. So it is
not necessary to have properties in the maven pom.
I have introduced this style in the jpa subproject and also configured
the new bnd baselining instead of the Aries version plugin. I really
like the results and wanted to introduce them to
the Aries community as a proposal to use this in the future.
For reference this is how the parent looks like:
https://github.com/apache/aries/blob/trunk/jpa/jpa-parent/pom.xml
I am not using the aries parent as I was not able to reset the maven
bundle plugin settings. I copied the minimal necessary configs into the
parent. I think we probably could also slim down the real aries parent.
This is how a typical pom looks after the change:
https://github.com/apache/aries/blob/trunk/jpa/jpa-container/pom.xml
I set a baseline version for all modules as a default. Each module can
change this if necessary and also choose to skip the baselining.
I have configured bnd to only fail on errors not warnings. This allows
that we do a larger version jump than the minimum but will fail if we do
not increase the package versions as necessary.
This is the osgi config file. Btw it is possible to use all the maven
properties in such files.
https://github.com/apache/aries/blob/trunk/jpa/jpa-container/osgi.bnd
What do you think about the changes?
Christian
---
This is what I configured for the maven bundle plugin in the parent:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.5.3</version>
<extensions>true</extensions>
<configuration>
<instructions>
<_include>osgi.bnd</_include>
</instructions>
</configuration>
<executions>
<execution>
<id>baseline</id>
<goals>
<goal>baseline</goal>
</goals>
<configuration>
<comparisonVersion>${baseline}</comparisonVersion>
<skip>${baseline.skip}</skip>
<failOnError>true</failOnError>
</configuration>
</execution>
</executions>
</plugin>