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

Describe explicit and recommended version for VersionRange.createFromVersionSpec()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.8.1
    • 3.8.2, 4.0.0-alpha-1, 4.0.0
    • None
    • None

    Description

      I would expect a version range for a single version to not contain any other versions, but it seems this is not the case, because this test fails on the second assertion:

      @Test
      void range_with_single_version_should_not_contain_other_version() {
              VersionRange singleVersionRange = VersionRange.createFromVersionSpec("1.0.0");
      
              assertThat(singleVersionRange.containsVersion(new DefaultArtifactVersion("1.0.0"))).isTrue();
              assertThat(singleVersionRange.containsVersion(new DefaultArtifactVersion("2.0.0"))).isFalse();
      }
      

      Is this a bug, or do I misinterpret what a single version range is? Does maven-artifact have a concept for a version range that only contains a single version?

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              breun Nils Breunese
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: