The site
http://books.sonatype.com/mvnref-book/reference/pom-relationships-sect-pom-syntax.html
states
If a version contains the string “-SNAPSHOT,” then Maven will expand this token to a date and time value converted to UTC (Coordinated Universal Time) when you install or release this component.
Is this literally true in the sense that not only the usual examples of 1.2.3-SNAPSHOT
behave like a SNAPSHOT version, but also something like 1.2.3-RC-SNAPSHOT
or 1.2.3-SNAPSHOT-RC
?
It is true that every version ending with SNAPSHOT
will be replaced with the date/time value converted to UTC.
This transformation is done inside the class SnapshotTransformation
of the Maven source code:
String newVersion = snapshot.getTimestamp() + "-" + snapshot.getBuildNumber(); version = StringUtils.replace( baseVersion, Artifact.SNAPSHOT_VERSION, newVersion );
What is considered a SNAPSHOT version can be seen in the class ArtifactUtils
: this code considers that a version is a SNAPSHOT version if its version ends with "SNAPSHOT"
ignoring case. For this case, the code also adds a dash before the SNAPSHOT if it is not already there.
So, judging from the source code, the book is partially right: it should be "ends with" instead of "contains".