I want to set a release version for my project. I use an aggregate pom for all modules. Each module parent is not the aggregate pom mentioned before.
My question differs from Updating version numbers of modules in a multi-module Maven project question, there the aggregate pom is a parent pom as well.
The aggregate pom.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>aggregate</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>
<modules>
<module>module1</module>
</modules>
</project>
Where the module1 pom.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>module-1</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>com.example</groupId>
<artifactId>parent1</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../../parent1/pom.xml</relativePath>
</parent>
</project>
When I execute:
mvn versions:set -DnewVersion=0.0.1
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] module-1
[INFO] aggregate
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building aggregate 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.3:set (default-cli) @ aggregate ---
[INFO] Searching for local aggregator root...
[INFO] Local aggregation root: C:\Users\maxim.kirilov\workspace\maven-games\aggregate
[INFO] Processing change of com.example:aggregate:0.0.1 -> 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] module-1 ........................................... SKIPPED
[INFO] aggregate .......................................... SUCCESS [ 0.962 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
Why module-1 is skipped? I read some articles that suggests to invoke the maven set version command for each module separately, does maven support for cleaner solution?