Affects Version/s: 2.0
Fix Version/s: None
Environment:Perforce, jdk1.6.0_07, Maven 2.2.1
Number of attachments :
The issue has been discussed in the user mailing list, cf.
I'm releasing a Maven2 multi-module project. One of the modules is a POM
project ("assembly project") that uses the maven-assembly-plugin in order to
build an assembly (zip archive). The artifacts to be assembled are specified
via dependencies in the POM. They point to modules contained in the same
multi-module project. The project build is running fine and produces the desired results.
The project structure is as follows:
When running mvn release:prepare on this multi-module project, the build of
the assembly project commons.distribution fails with the message that the dependencies cannot be
resolved. These dependencies are reported with the version that should be
released, e.g. 0.0.3. Before running the goal, all dependency versions are 0.0.3-SNAPSHOT.
What seems to happen is that the snapshot version 0.0.3-SNAPSHOT is
replaced by release version 0.0.3 through the release plugin and consequently the assembly plugin tries to resolve the dependencies based on version
0.0.3 which however do not yet exist in the repository at that point.
It was suggested in the mail thread that the reactor should be able to handle the dependencies correctly and the following test was proposed:
1. mvn versions:set -DnewVersion=0.0.3-reltesting-SNAPSHOT
2. mvn clean verify
3. mvn versions:revert
However this test fails in the same manner as described above.
The issue can be reproduced with any multi-module project of the structure
where T is a top-level project and A is a child project of packaging type POM that assembles module X (and possibly other modules
as indicated by the ellipsis).