You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "David M. Lloyd (Jira)" <ji...@apache.org> on 2023/02/28 15:48:00 UTC

[jira] [Updated] (MRESOLVER-334) Maven Resolver's GenericVersionScheme diverges from the spec

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

David M. Lloyd updated MRESOLVER-334:
-------------------------------------
    Description: 
The [specification for version resolution|https://maven.apache.org/pom.html#version-order-specification] indicates these facts which disagree with the implementation in {{{}GenericVersionScheme{}}}:
 * "The Maven coordinate is split in tokens between dots ('{{{}.{}}}'), hyphens ('{{{}-{}}}') and transitions between digits and characters." - in {{{}GenericVersion{}}}, the underscore ('{{{}_{}}}') is also treated as a separator.
 * In the examples area, it says that while "{{{}1-sp.1{}}}" {{>}} "{{{}1-ga.1{}}}", at the same time "{{{}1-sp-1{}}}" {{<}} "{{{}1-ga-1{}}}" {{=}} "{{{}1-1{}}}" due to "trailing 'null' values at each hyphen". But in addition to being untrue in the actual implementation, this relation is clearly nonsensical because it would place {{sp}} before {{{}ga{}}}, which would have a tremendous negative impact on the existing artifact ecosystem if it were carried out in the implementation.
 * Also in the example area, we have "{{{}1.foo{}}}" {{=}} "{{{}1-foo{}}}" {{<}} "{{{}1-1{}}}" {{<}} "{{{}1.1{}}}", whereas in practice it is (rightly) "{{{}1.foo{}}}" {{=}} "{{{}1-foo{}}}" {{<}} "{{{}1-1{}}}" {{=}} "{{{}1.1{}}}".

In my opinion all of these things are spec errors so I'd be happy to see the spec page be updated and this bug consequently closed as "out of date", especially since the implementation behavior has been in the wild for some time.

  was:
The [specification for version resolution|https://maven.apache.org/pom.html#version-order-specification] indicates these two facts which disagree with the implementation in {{GenericVersionScheme}}:

* "The Maven coordinate is split in tokens between dots ('{{.}}'), hyphens ('{{-}}') and transitions between digits and characters." - in {{GenericVersion}}, the underscore ('{{_}}') is also treated as a separator.
* In the examples area, it says that while "{{1-sp.1}}" {{>}} "{{1-ga.1}}", at the same time "{{1-sp-1}}" {{<}} "{{1-ga-1}}" {{=}} "{{1-1}}" due to "trailing 'null' values at each hyphen". But in addition to being untrue in the actual implementation, this relation is clearly nonsensical because it would place {{sp}} before {{ga}}, which would have a tremendous negative impact on the existing artifact ecosystem if it were carried out in the implementation.
* Also in the example area, we have "{{1.foo}}" {{=}} "{{1-foo}}" {{<}} "{{1-1}}" {{<}} "{{1.1}}", whereas in practice it is (rightly) "{{1.foo}}" {{=}} "{{1-foo}}" {{<}} "{{1-1}}" {{=}} "{{1.1}}".

In my opinion all of these things are spec errors so I'd be happy to see the spec page be updated and this bug consequently closed as "out of date", especially since the implementation behavior has been in the wild for some time.


> Maven Resolver's GenericVersionScheme diverges from the spec
> ------------------------------------------------------------
>
>                 Key: MRESOLVER-334
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-334
>             Project: Maven Resolver
>          Issue Type: Bug
>          Components: Resolver
>    Affects Versions: 1.9.5
>            Reporter: David M. Lloyd
>            Priority: Major
>
> The [specification for version resolution|https://maven.apache.org/pom.html#version-order-specification] indicates these facts which disagree with the implementation in {{{}GenericVersionScheme{}}}:
>  * "The Maven coordinate is split in tokens between dots ('{{{}.{}}}'), hyphens ('{{{}-{}}}') and transitions between digits and characters." - in {{{}GenericVersion{}}}, the underscore ('{{{}_{}}}') is also treated as a separator.
>  * In the examples area, it says that while "{{{}1-sp.1{}}}" {{>}} "{{{}1-ga.1{}}}", at the same time "{{{}1-sp-1{}}}" {{<}} "{{{}1-ga-1{}}}" {{=}} "{{{}1-1{}}}" due to "trailing 'null' values at each hyphen". But in addition to being untrue in the actual implementation, this relation is clearly nonsensical because it would place {{sp}} before {{{}ga{}}}, which would have a tremendous negative impact on the existing artifact ecosystem if it were carried out in the implementation.
>  * Also in the example area, we have "{{{}1.foo{}}}" {{=}} "{{{}1-foo{}}}" {{<}} "{{{}1-1{}}}" {{<}} "{{{}1.1{}}}", whereas in practice it is (rightly) "{{{}1.foo{}}}" {{=}} "{{{}1-foo{}}}" {{<}} "{{{}1-1{}}}" {{=}} "{{{}1.1{}}}".
> In my opinion all of these things are spec errors so I'd be happy to see the spec page be updated and this bug consequently closed as "out of date", especially since the implementation behavior has been in the wild for some time.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)