Hello,
I am trying to perform a release using a multi-module maven project. My objective is to modify the version of all poms, and create a tag in the SCM, which is why I am using the maven release plugin.
This project has a hierarchy that I have simplified as:
example/
module1/
module2/
module-jni-linux/
module-jni-macosx/
The pom.xml of example
contains its modules like this:
<modules>
<module>module1</module>
<module>module2</module>
</modules>
And the pom.xml of module2
contains modules that depend on a profile determined by the OS type:
<profiles>
<!-- profile for linux -->
<profile>
<id>linux</id>
<activation>
<os>
<name>linux</name>
</os>
</activation>
<modules>
<module>module-jni-linux</module>
</modules>
</profile>
<!-- profile for mac os -->
<profile>
<id>macosx</id>
<activation>
<os>
<name>mac os x</name>
</os>
</activation>
<modules>
<module>module-jni-macosx</module>
</modules>
</profile>
Finally, each module-jni-*
uses the native-maven-plugin to compile some C/C++ sources and generate a shared library.
The problem:
When I try a mvn release:prepare -DdryRun=true
in a Mac OS X box, I realize that the module-jni-linux
is not taken into account by the release process. That means that while all modules pass to a 1.0.0/1.0.1-SNAPSHOT version, module-jni-linux
is not modified. What I would like when doing a release:prepare
is that all submodules are updated even if its profile has not been activated.
I tried to active both profiles with mvn -P linux,macosx ...
, but the module-jni-linux
will not build under mac (and viceversa).
How can I perform a release that updates the version of both submodules?