Question

Goal

Multimodule maven release with tags per module

Situation

Assume the following project structure for a Maven-based Java project:

xx-parent
xx-moduleA
xx-moduleB
xx-moduleC/submodule1
xx-moduleC/submodule2
xx-moduleC/submodule3

The project structure in Subversion is as follows:

xx-parent/trunk
xx-moduleA/trunk
xx-moduleB/trunk
xx-moduleC/trunk/submodule1
xx-moduleC/trunk/submodule2
xx-moduleC/trunk/submodule3

My goal is to create tags per module when performing a release:

xx-parent/tags/xx-parent-1.0
xx-moduleA/tags/xx-moduleA-1.0
xx-moduleB/tags/xx-moduleB-1.0
xx-moduleC/tags/xx-moduleC-1.0

In the past, each module was built and released separately. As the project grew larger (30 modules), the time to build a release increased. I would like to change the project to a multi-module set up to perform a reactor build and release. Building doesn't seem to be a problem, but creating tags per module is.

The maven-release-plugin seems to insist on making only a single tag for the whole project/release. I'm looking for a way to create multiple tags, e.g. a tag per module.

What I have tried so far

  • Creating a xx-all Subversion alias, which checks out all sub-modules, so I can reference them with <module>../xx-moduleB</module>
  • Enabling commitByProject, which did commit per module, but not tag per module. See
  • Each module has its own <scm> elements in the pom.xml, but they are not used when performing a reactor release.
  • mvn --batch-mode -DcommitPerProject=true -DautoVersionSubmodules=true -Drelease.version=1.0.6 release:prepare release:perform

Problems

  • maven-release-plugin does not create a svn tag per module
  • maven-release-plugin overwrites the <scm> tag with invalid URLs, e.g. nested "trunk"-tags under the xx-parent tag

Question

How can I set up this project with a Maven release process, a multi-module layout and still get separate tags per module?

References

http://jira.codehaus.org/browse/MRELEASE-261 (Closed) and MRELEASE-561 (Open)

Was it helpful?

Solution

According to Arnaud Héritier (an Apache Maven PMC member),
Maven can't handle composite applications like module-A v0.1, module-B v0.3.
Maven consider a project and all his sub-modules as a unique set.

see: http://blog.aheritier.net/maven-release-plugin-2-0/ (9 June 2010)

Maybe the situation changed since with Maven 3 ?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top