I wonder if it is possible to override project.version/version variable in maven via command line?
The following doesn\'t work:
mvn deploy -Dversion=1.
In Maven 3.5+, if you put the following in your pom.xml
${revision}
...
1.0.0-SNAPSHOT
it will use 1.0.0-SNAPSHOT by default, but you can override it on the command line:
mvn -Drevision=2.0.0-SNAPSHOT clean package
Apparently this only works if the placeholder property is called revision
(you can also use changelist
and sha1
placeholders in your version).
See https://maven.apache.org/maven-ci-friendly.html