-
Notifications
You must be signed in to change notification settings - Fork 140
Description
David M. Lloyd opened MRESOLVER-334 and commented
The specification for version resolution 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 placesp
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.
Affects: 1.9.5
Issue Links:
-
MNG-5568 ComparableVersion's breaks contract for Comparable, in some edgecases the comparisons are not transitive
-
MNG-6964 Maven version sorting is internally inconsistent
-
MNG-7644 Fix version comparison where .X1 < -X2 for any string qualifier X
-
MNG-7701 Incompatible version sorting changes
Remote Links:
Backported to: 2.0.0-alpha-7