You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mvn -Drevision=1.0.0-SNAPSHOT clean package
Our use-case is that you want this revision property (can be configurable) to be set by a Maven plugin using tag information from the scm (typically, git).
The revision property should be set as follows:
note: will be set to variants of nr of commits
if no tags in repo: set to 0.0.1- (e.g. 0.0.1-23) (left-padded due to Maven bug comparing qualifer as a string)
if tags exist
if latest commit is tagged (assume a release): set revision to tag (e.g. 1.0.1)
if it is a previous tag: use the tag, bump patch level, set build number to and add <-SNAPSHOT> (e.g. 0.5.1 -> 0.5.2--SNAPSHOT
That is the basics. I was contemplating writing a plugin for it, but we'll rather so it incorporated in into this plugin.
Build number will be handled correctly by Maven as can be seen here:
java -jar ${MAVEN_HOME}/lib/maven-artifact-3.9.6.jar 1.1 1.2.1-1 1.2.1-1-SNAPSHOT 1.2.1-9 1.3
Display parameters as parsed by Maven (in canonical form and as a list of tokens) and comparison result:
1. 1.1 -> 1.1; tokens: [1, 1]
1.1 < 1.2.1-1
2. 1.2.1-1 -> 1.2.1-1; tokens: [1, 2, 1, [1]]
1.2.1-1 > 1.2.1-1-SNAPSHOT
3. 1.2.1-1-SNAPSHOT -> 1.2.1-1-snapshot; tokens: [1, 2, 1, [1, [snapshot]]]
1.2.1-1-SNAPSHOT < 1.2.1-9
4. 1.2.1-9 -> 1.2.1-9; tokens: [1, 2, 1, [9]]
1.2.1-9 < 1.3
5. 1.3 -> 1.3; tokens: [1, 3]
The text was updated successfully, but these errors were encountered:
Maven supports Maven CI Friendly Versions since version 3.5.
It allows the user to set a placeholder
<version>${revision}</version>
that can be replaced from command line using:
e.g.
mvn -Drevision=1.0.0-SNAPSHOT clean package
Our use-case is that you want this revision property (can be configurable) to be set by a Maven plugin using tag information from the scm (typically, git).
The revision property should be set as follows:
note: will be set to variants of nr of commits
That is the basics. I was contemplating writing a plugin for it, but we'll rather so it incorporated in into this plugin.
Build number will be handled correctly by Maven as can be seen here:
The text was updated successfully, but these errors were encountered: