Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7559

ComparableVersion vs versions with custom qualifiers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 3.8.3
    • 4.x / Backlog
    • None
    • None

    Description

      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".

          @Test
          public void testComparableVersionWithCustomQualifier()
          {
              assertThat( new ComparableVersion( "2.3" ).compareTo( new ComparableVersion( "2.3-pfd" ) ),
                      greaterThan( 0 ) );
          }
      

      Attachments

        1. image-2022-10-22-18-22-11-591.png
          96 kB
          Gwénaël Ruelland

        Activity

          People

            Unassigned Unassigned
            ajarmoniuk Andrzej J.
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: