You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Marcono1234 (Jira)" <ji...@apache.org> on 2020/12/27 02:14:00 UTC
[jira] [Updated] (MNG-7058) Dependency Version Requirement
Specification conflicts with SemVer pre-release specification
[ https://issues.apache.org/jira/browse/MNG-7058?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marcono1234 updated MNG-7058:
-----------------------------
Description:
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.
was:
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.
> 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)