Marcono1234 created MNG-7058:
--------------------------------

             Summary: Dependency Version Requirement Specification conflicts 
with SemVer pre-release specification
                 Key: MNG-7058
                 URL: https://issues.apache.org/jira/browse/MNG-7058
             Project: Maven
          Issue Type: Bug
            Reporter: Marcono1234


Possibly related to MNG-6420 and MNGSITE-387

The Maven [Version Order 
Specification|https://maven.apache.org/pom.html#version-order-specification] 
says:
{quote}
Non-numeric ("qualifiers") tokens have the alphabetical order, except for the 
following tokens which come first in this order:
"alpha" < "beta" < "milestone" < "rc" = "cr" < "snapshot" < "" = "final" = "ga" 
< "sp"
{quote}
It appears the intention of the author was that no qualifier ({{""}}) as well 
as {{"final"}} and {{"ga"}} represent a _release_.
However, because due to this exception these qualifiers always come first it 
conflicts with [SemVer 1.0.0 
ยง4|https://semver.org/spec/v1.0.0.html#spec-item-4] defining pre-releases:
{quote}
A pre-release version number MAY be denoted by appending an arbitrary string 
immediately following the patch version and a dash.
{quote}

Imagine someone calls their pre-releases _alpha_, _beta_  and _gamma_. Version 
_1.2.0-gamma_ is according to SemVer a pre-release, yet if a release _1.2.0_ 
(or _1.2.0-final_) is released, Maven considers the pre-release newer than the 
release:
{code}
java -jar .\maven-artifact-3.6.2.jar 1.2.0 1.2.0-gamma
{code}
{code:title=Output}
1. 1.2.0 == 1.2
   1.2.0 < 1.2.0-gamma
2. 1.2.0-gamma == 1.2-gamma
{code}


This could be solve by specifying that an empty string ({{""}}) = {{"final"}} = 
{{"ga"}} < {{"sp"}} always come after any other qualifier. However, that might 
be a breaking change.



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

Reply via email to