Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-20890

VersionComparator compare string, not numbers

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.18.1
    • Fix Version/s: None
    • Component/s: Repository
    • Labels:
    • Environment:
      CentOS7

      Description

      The class VersionComparator imported from org.sonatype.nexus.common.app use GenericVersion from org.eclipse.aether.util.version. When method compareTo compare two versions, it compare them item by item, and when it is two numbers, it compare them as String and not as Number (you can see it in code here).

      In example if you have a version 0.9.0, it is considered as greater than 0.10.0. And tests in VersionComparatorTest does not detect it.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              ndrufin Nicolas D
              Last Updated By:
              Peter Lynch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title