[ https://issues.apache.org/jira/browse/MNG-5974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17474300#comment-17474300 ]
Tuure Laurinolli commented on MNG-5974: --------------------------------------- Perhaps the class javadoc could then be improved to match what the version order specification says? I missed the "See also" link in the javadoc and took the javadoc itself to be an accurate description of the parsing done. > ComparableVersion fails with semver.org-style milestone versions > ---------------------------------------------------------------- > > Key: MNG-5974 > URL: https://issues.apache.org/jira/browse/MNG-5974 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories > Affects Versions: 3.3.9, 3.8.4 > Reporter: Tuure Laurinolli > Priority: Major > > ComparableVersion does not correctly parse semver.org-style milestone > versions where the "m" is separated from the milestyne number by a dot, like > "1.0.0-m.3". > It seems that Maven only recognizes the "m" alias for "milestone" if it's > immediately followed by a digit. I don't think this is according to the class > javadoc, which does not mention that some aliases require the alias to be > followed by a number to be effective. > Test case: > {code} > import org.apache.maven.artifact.versioning.ComparableVersion; > import org.junit.Test; > import static org.junit.Assert.assertTrue; > public class VersionTest { > @Test > public void testSortVersions() throws Exception { > final ComparableVersion m2 = new ComparableVersion("1.2.3-m.2"); > final ComparableVersion rc1 = new ComparableVersion("1.2.3-rc.1"); > assertTrue(rc1.compareTo(m2) > 0); > } > } > {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)