According to the manual , with Maven 3 we are forced to use uniqueSnapshots=true. This means that each deployment is 1.0-SNAPSHOTactually supported by some unique, canonical identifier, for example. 1.0-20080207-230803-1.
As a result mvn deploy, artefacts arise during the call , the canonical version of which cannot be determined before the executable file is called mvn.
Therefore, if you want to invoke any operations with a unique identifier generated subsequently, you should try to extract the generated identifier from the maven executable file after completion mvn deploy.
Is there such a mechanism for obtaining a unique identifier?
For example, it mvn deploywill produce the following output:
Uploading: https://oss.sonatype.org/content/repositories/snapshots/io/airlift/slice/0.11-SNAPSHOT/slice-0.11-20150220.165404-2.jar
But there seems to be no way to access the IDs 0.11-20150220.165404-2without parsing the output from Maven.
Example scenario: mvn build causes a new (unique) artifact to be redirected to the internal repository manager. After that, we want to send an HTTP notification to inform about any remote application of the new version of SNAPSHOT application.
Although our repository manager allows us to request the latest version of SNAPSHOT, it is not the same as passing absolute links to specific versions.
source
share