I have a multi-module project with a common parent pom for all modules and the / build pom aggregator. I am trying to use the maven-versions-plugin to update / install versions of all my modules, but it continues to skip child modules.
Project layout: - common / pom.xml (build pom) - common / superpom / pom.xml (parent pom) - module1 / pom.xml (module1 pom) - module2 / pom.xml (module2 pom)
common / pom.xml:
<project> <modelVersion>4.0.0</modelVersion> <groupId>com.bic</groupId> <artifactId>builder</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <name>Builder</name> <modules> <module>../module1</module> <module>../module2</module> </modules> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>versions-maven-plugin</artifactId> <version>2.1</version> </plugin> </plugins> </build> </project>
I tried adding a plugin to the pom assembly (common / pom.xml) and then called:
mvn versions:set -DnewVersion=999999
Maven lists all the details found in child modules, so I know that it parses them correctly:
Props: {project.version=50, project.parent.version=1.0-SNAPSHOT, project.parent.groupId=com.bic, project.artifactId=module1, project.groupId=com.bic, project.parent.artifactId=common} Props: {project.version=50, project.parent.version=1.0-SNAPSHOT, project.parent.groupId=com.bic, project.artifactId=module2, project.groupId=com.bic, project.parent.artifactId=common}
but in fact it does not update the versions of any of the poms modules, which I do.
[INFO] Reactor Summary: [INFO] [INFO] Module1 ........................................ SKIPPED [INFO] Module2 ........................................ SKIPPED [INFO] Builder ........................................ SUCCESS [ 2.037 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.975 s [INFO] Finished at: 2015-01-26T11:48:11-05:00 [INFO] Final Memory: 24M/44M [INFO] ------------------------------------------------------------------------
And the goal of update-child-modules does not allow me to explicitly set the version number for child modules.
Am I using the plugin incorrectly?
java maven version
Eric B.
source share