[ https://issues.apache.org/jira/browse/MNG-7559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17651585#comment-17651585 ]
ASF GitHub Bot commented on MNG-7559: ------------------------------------- sultan commented on PR #929: URL: https://github.com/apache/maven/pull/929#issuecomment-1363828385 > Bah, I am really about to puke. > > So much completely for something quite obvious, I guess. > > Looking at `"<<<.qualifier>>>" < "<<<-qualifier>>>" < "<<<-number>>>" < "<<<.number>>>"` it does not make sense, why the dot before a hyphen. If now the equalty applies to qualifiers, why not to nubers as well? The problem ist how to diffentiate between 2.3.4 where 4 is a actually a numeric qualfier? the parser was and is treating numbers and string differently (else/if). the previous parser * 2.3.4 parses to [ 2, 3, 4 ] * 2.3-4 parse to [ 2, 3, [4] ] * 2.3-RC4 parses to [ 2, 3, [ RC, [4] ] ] * 2.3.RC4 used to parse to [ 2, 3, RC, [4] ] i can see a benefit of change with .RC4 = -RC4 and .RC1 < -RC2 but i cannot yet see a benefit of change for numbers, as you may want to keep 1.0.0-2 = 1-2 = 1.0-2 treat - as dot for numbers will lead to bad surprises. we might not want 1.0.0-2 = 1.0.0.2 < 1.0-2 = 1.0.2 < 1-2 = 1.2 we should discourage the use of numeric qualifiers -1, -2 -N in the docs i dont see what the projects maintainers would want for these numbers to mean and how they would compare with strings (< or >?) > 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 > Priority: Major > Fix For: 4.x / Backlog > > 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)