[ 
https://issues.apache.org/jira/browse/MNG-7058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17255286#comment-17255286
 ] 

Marcono1234 commented on MNG-7058:
----------------------------------

The "Version Order Specification" section starts with:
{quote}
If version strings are syntactically correct Semantic Versioning 1.0.0 version 
numbers, then in almost all cases version comparison follows the precedence 
rules outlined in that specification.
{quote}

I chose "gamma" just as example to not make this too contrived; I am not asking 
for any special casing for that word.
My point was rather that the complete concept of SemVer pre-releases cannot be 
applied to Maven due to the exception outlined above.

> 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
>            Priority: Minor
>
> 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}
> This can result in situations where a release would come before a pre-release.
> 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