# Maven-metadata.xml is not accurate after version scheme change

**URL:** <https://community.sonatype.com/t/maven-metadata-xml-is-not-accurate-after-version-scheme-change/4728>\
**Category:** Sonatype Nexus Repository\
**Created:** [August 10, 2020, 3:39pm UTC](https://community.sonatype.com/t/maven-metadata-xml-is-not-accurate-after-version-scheme-change/4728 "2020-08-10T15:39:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksclarke](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/ksclarke/32/1409_2.png) [@ksclarke](https://community.sonatype.com/u/ksclarke)\
**Post date:** [August 10, 2020, 3:39pm UTC](https://community.sonatype.com/t/maven-metadata-xml-is-not-accurate-after-version-scheme-change/4728/1 "2020-08-10T15:39:48Z")

</div>

We’ve changed our artifact versioning scheme from 0.1.0 to v2-0.1.0. However we notice, in the maven-metadata that’s generated, the older version (without the v2) is still marked as the latest, despite the file itself having been updated with the latest version (now using the v#-\* scheme). We use the Nexus staging Maven plugin, but I’m not sure if the maven-metadata file is created by it or on Nexus itself. I’m guessing it’s determining “latest” by a alphanumeric sort rather than by the upload dates. Is there a way to work around/fix this so that the latest is actually the most recent one uploaded? Here is an example: [https://oss.sonatype.org/content/repositories/snapshots/info/freelibrary/jiiify-presentation/maven-metadata.xml](https://oss.sonatype.org/content/repositories/snapshots/info/freelibrary/jiiify-presentation/maven-metadata.xml)

---

<div class="post-metadata">

**Author:** ![mpiggott](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mpiggott](https://community.sonatype.com/u/mpiggott)\
**Post date:** [August 10, 2020, 4:38pm UTC](https://community.sonatype.com/t/maven-metadata-xml-is-not-accurate-after-version-scheme-change/4728/2 "2020-08-10T16:38:09Z")

</div>

That isn’t a proper maven version number so comparison won’t work - [https://cwiki.apache.org/confluence/display/MAVENOLD/Versioning](https://cwiki.apache.org/confluence/display/MAVENOLD/Versioning)

---

<div class="post-metadata">

**Author:** ![ksclarke](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/ksclarke/32/1409_2.png) [@ksclarke](https://community.sonatype.com/u/ksclarke)\
**Post date:** [August 10, 2020, 5:16pm UTC](https://community.sonatype.com/t/maven-metadata-xml-is-not-accurate-after-version-scheme-change/4728/3 "2020-08-10T17:16:46Z")

</div>

Okay, thanks. Then nothing to be done then, I guess. We considered putting it as a qualifier (after version) but felt that was misleading since versions will be based on v2 or v3 lines rather than v2 or v3 being synchronized into a single version. I guess Maven would want us to separate them into separate projects. I guess we should add a warning about any service using the “latest” element in maven-metadata.xml. We discovered this was a problem when checking [javadoc.io](http://javadoc.io).
