Nexus Repository 2 officially sunsetted June 30, 2025. Visit my.sonatype.com for archived documentation. Migrate to Sonatype Nexus Repository 3 as soon as possible.
The maven-metadata.xml files are not updated by Nexus Repository 2 during deployment, they are updated by Maven. It downloads the file, updates it, and then redeploys it.
Maven will update the "release" field only during the following scenarios:
- Maven 2.x deploys using -DupdateReleaseInfo=true
- Maven 3.x deploys a non-snapshot artifact
The "latest" field is only intended for plugin resolution and is only set upon deployment of a maven-plugin artifact, both for Maven 2.x and 3.x regardless of whether a release or snapshot gets deployed.
Also, Maven will update these fields with whatever version it is currently deploying, so "latest" and "release" will not necessarily correspond to the highest version number.
Note that Nexus Repository 2 will set the latest tag if you tell it to rebuild metadata, but since Maven does not, this behavior cannot be relied upon.
If you need the highest version of a released non-plugin artifact you should be using version ranges, see section 3.4.3 here.
If you're trying to retrieve the latest timestamped version of a snapshot you can use the REST API as described here.