You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2020/10/17 15:52:00 UTC

[jira] [Closed] (MNG-6254) Clarification on sorting in Repository Metadata

     [ https://issues.apache.org/jira/browse/MNG-6254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Osipov closed MNG-6254.
-------------------------------
    Resolution: Not A Problem

The incorrect location has been fixed by another ticket. The reaon by I am closing this is that your assumption is incorrect. {{java.util.List}} says: An ordered collection (also known as a sequence).
No sentence about sorted. No assumption can be made about the sorting or specific order of elements. It is an implementation detail. It is imprerative to sort manually, in fact, there is no reliable sorting order because your artifact version class does not cover all cases.

> Clarification on <versions> sorting in Repository Metadata
> ----------------------------------------------------------
>
>                 Key: MNG-6254
>                 URL: https://issues.apache.org/jira/browse/MNG-6254
>             Project: Maven
>          Issue Type: Improvement
>          Components: Artifacts and Repositories
>    Affects Versions: 3.5.0
>            Reporter: Markus Karg
>            Priority: Major
>
> The document http://maven.apache.org/ref/3.3.9/maven-repository-metadata/repository-metadata.html explains that <versions> does contain a _List_<Version>, hence is _sorted_.
> When pulling _real _metadata from Maven Central, e. g. http://repo.maven.apache.org/maven2/javax/ws/rs/jsr311-api/maven-metadata.xml, it is apparent that the content of <version> is _not_ sorted (in this example, 1.1-ea is listed _after_ 1.1, which is a violation of the sorting, because -ea must be listed _before_ 1.1). So effectively Maven Central devliers _unsorted_ versions.
> Also, the effectively listed XSD http://maven.apache.org/xsd/metadata-1.1.0.xsd is nonexistent, so cannot be looked but whether Maven Central is wrong, or whether actually the specification should say it must be Set<Version> instead of List<Version>.
> To sum up, there should be a clarification whether <version> must be sorted according to the Maven Version Numbering Schema, whether it must be Set vs List, and whether the missing XSD should be uploaded.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)