[
https://issues.apache.org/jira/browse/MNG-7559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17651501#comment-17651501
]
ASF GitHub Bot commented on MNG-7559:
-------------------------------------
ajarmoniuk commented on PR #929:
URL: https://github.com/apache/maven/pull/929#issuecomment-1363654569
Hi @michael-o if I may, I think the current implementation is in line with
the specification as I have a feeling that the specification has been based on
it 😄
The problem is that the spec deviates from SemVer in how it treats
non-standard qualifiers, like the "pfd" here. According to SemVer, all
qualifiers should be treated as less than -.number whereas with "the spec" all
non-standard qualifiers are treated as later than -.number.
As is the case of "-pdf" which is later than the release.
So, adding "pfd" as a recognised qualifier would mean that the spec also
needs to be updated. Which is why it's a breaking change and not a bugfix.
> ComparableVersion vs versions with custom qualifiers
> ----------------------------------------------------
>
> Key: MNG-7559
> URL: https://issues.apache.org/jira/browse/MNG-7559
> Project: Maven
> Issue Type: Bug
> Affects Versions: 3.8.3
> Reporter: Andrzej Jarmoniuk
> Assignee: Michael Osipov
> Priority: Major
> Fix For: 3.8.x-candidate, 3.9.0, 4.0.0-alpha-3, 4.0.0-alpha-4,
> 4.0.0
>
> Attachments: image-2022-10-22-18-22-11-591.png
>
>
> Since I know that ComparableVersion was brought to Maven from
> versions-maven-plugin, it turns out the bug described here:
> https://github.com/mojohaus/versions-maven-plugin/issues/744
> also exists in maven, at least in 3.8.3.
> According to the maven version spec, versions containing a qualifier should
> be treated as less major than the same versions without the qualifier.
> Currently it's only the case for a few "standard" qualifiers, e.g. "-rc*",
> "-alpha", etc.
> However, it looks like "2.3-pfd" is deemed less major than "2.3".
> {code:java}
> @Test
> public void testComparableVersionWithCustomQualifier()
> {
> assertThat( new ComparableVersion( "2.3" ).compareTo( new
> ComparableVersion( "2.3-pfd" ) ),
> greaterThan( 0 ) );
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)