How can I customize a unique version string of Maven?

I would like to know what options exist for setting the timestamp string used when deploying the Maven artifact when <uniqueVersion>true</uniqueVersion> . Ideally, we would like to include the change list number from the source control instead of the timestamp, as this is a more reliable means of determining which functions and bug fixes are in this assembly.

+6
maven-2 continuous-integration
source share
1 answer

I would like to know what options exist for setting the timestamp string used when deploying the Maven artifact when setting true.

You cannot configure it, a timestamp line is a well-defined internal thing that should be used as is or not (if you set uniqueVersion to false in the distributionManagement element).

From the Maven book (for interested readers, this really will not help you):

3.3.1.2. SNAPSHOT Versions

Maven options may contain a string literally means that the project is being actively developed. If the version contains the string "SNAPSHOT", then Maven will expand this token to the date and time value converted to UTC (coordinated Universal Time) during installation or release this component. For example, if your project has version "1.0-SNAPSHOT" and you deploy it artifact projects to the Maven repository, Maven will expand this version to "1.0-20080207-230803-1" if you were to deploy the release at 11:08 PM 7 February 2008 UTC. In other words, when you deploy a snapshot, you do not release the software component; You release a snapshot of a component at a specific time.

+10
source share

All Articles