Some have suggestions (for example: @carlspring) that “LATEST” does not really indicate the highest version available, given both releases and snapshots; they suggest that this is the most recently deployed, but I do not agree. This is what happens with the Sonatype Nexus ™ 2.11.2-0:
Intending to start with:
<metadata modelVersion="1.1.0"> <groupId>com.acme</groupId> <artifactId>versioningtest</artifactId> <versioning> <latest>1.0.3-SNAPSHOT</latest> <release>1.0.1</release> <versions> <version>1.0.0-SNAPSHOT</version> <version>1.0.0</version> <version>1.0.1-SNAPSHOT</version> <version>1.0.1</version> <version>1.0.2-SNAPSHOT</version> <version>1.0.3-SNAPSHOT</version> </versions> <lastUpdated>20150928081006</lastUpdated> </versioning> </metadata>
(A) The publication of the new 1.0.2-SNAPSHOT only increases the time stamp "lastupdated", it does NOT change the "last".
Now published 1.0.3:
<metadata> <groupId>com.acme</groupId> <artifactId>versioningtest</artifactId> <versioning> <latest>1.0.3</latest> <release>1.0.3</release> <versions> <version>1.0.0-SNAPSHOT</version> <version>1.0.0</version> <version>1.0.1-SNAPSHOT</version> <version>1.0.1</version> <version>1.0.2-SNAPSHOT</version> <version>1.0.3-SNAPSHOT</version> <version>1.0.3</version> </versions> <lastUpdated>20150928081408</lastUpdated> </versioning> </metadata>
(B) From here the publication of the new 1.0.2-SNAPSHOT only increases the time stamp "lastupdated", it does NOT change the "last". In addition, publication 1.0.2 only increases the timestamp "lastupdated", it does not change the "last":
<metadata> <groupId>com.acme</groupId> <artifactId>versioningtest</artifactId> <versioning> <latest>1.0.3</latest> <release>1.0.3</release> <versions> <version>1.0.0-SNAPSHOT</version> <version>1.0.0</version> <version>1.0.1-SNAPSHOT</version> <version>1.0.1</version> <version>1.0.2-SNAPSHOT</version> <version>1.0.2</version> <version>1.0.3-SNAPSHOT</version> <version>1.0.3</version> </versions> <lastUpdated>20150928081620</lastUpdated> </versioning> </metadata>
So in conclusion:
between two snapshots, even if the younger one becomes later, the oldest published ones will win last place if it has a higher version. (A)
between the snapshot of the Vs release, the higher version wins the LAST place. (IN)
Consequently, the Sonatype Nexus ™ 2.11.2-0, “LATEST” indicates the highest version available, taking into account both releases and snapshots.
QED
source share