Maven 2 & 3
  1. Maven 2 & 3
  2. MNG-2994

Snapshot repositories are not checked when using ranges

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.6
    • Fix Version/s: 3.0-beta-1
    • Labels:
      None
    • Environment:
      Windows XP, Cygwin
    • Complexity:
      Intermediate
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      4

      Description

      The attached patch demonstrates the problem by adding it0121. If the test repository has releases enabled, the test passes, when they are disabled, the test fails. This appears to be due to DefaultArtifact.isSnapshot returning false for unresolved ranges, thus causing snapshot repositories to be disabled when resolving artifacts.

      1. MNG-2994-2.patch
        7 kB
        Mark Hobson
      2. MNG-2994-3.patch
        13 kB
        Mark Hobson
      3. MNG-2994-core-it.patch
        2 kB
        Mark Hobson
      4. patch.txt
        6 kB
        Mark Hobson

        Issue Links

          Activity

          Hide
          Mark Hobson added a comment -

          After stepping through, it's actually ArtifactRepositoryMetadata.isSnapshot always returning false when queried by DefaultRepositoryMetadataManager.resolve. In turn, this is called by MavenMetadataSource.retrieveAvailableVersions from DefaultArtifactCollector.recurse when artifact.getVersion() == null, i.e. when ranges are being used.

          Show
          Mark Hobson added a comment - After stepping through, it's actually ArtifactRepositoryMetadata.isSnapshot always returning false when queried by DefaultRepositoryMetadataManager.resolve. In turn, this is called by MavenMetadataSource.retrieveAvailableVersions from DefaultArtifactCollector.recurse when artifact.getVersion() == null, i.e. when ranges are being used.
          Hide
          Brett Porter added a comment -

          I'd suggest adding a method that is an alternate to isSnapshot that is capable of expressing the difference, and use that from the metadata manager (retains backwards compat too).

          Show
          Brett Porter added a comment - I'd suggest adding a method that is an alternate to isSnapshot that is capable of expressing the difference, and use that from the metadata manager (retains backwards compat too).
          Hide
          Mark Hobson added a comment -

          Updated IT patch to sync with current trunk by renaming it0121 to it0123 - please apply before someone adds another it0123!

          Show
          Mark Hobson added a comment - Updated IT patch to sync with current trunk by renaming it0121 to it0123 - please apply before someone adds another it0123!
          Hide
          Mark Hobson added a comment -

          Committed and commented-out attached it0123.

          Show
          Mark Hobson added a comment - Committed and commented-out attached it0123.
          Hide
          Mark Hobson added a comment -

          Attaching MNG-2994-3.patch which is a fix, rather than an IT.

          Show
          Mark Hobson added a comment - Attaching MNG-2994 -3.patch which is a fix, rather than an IT.
          Hide
          Mark Hobson added a comment -

          Attaching MNG-2994-core-it.patch that fixes it0043 in relation to this issue.

          Show
          Mark Hobson added a comment - Attaching MNG-2994 -core-it.patch that fixes it0043 in relation to this issue.
          Hide
          John Casey added a comment -

          This will need to wait until the other snapshots-in-version-ranges issue (referenced as a prerequisite for this issue) is resolved. Otherwise, we risk changing existing build behavior for version ranges in very bad ways.

          Show
          John Casey added a comment - This will need to wait until the other snapshots-in-version-ranges issue (referenced as a prerequisite for this issue) is resolved. Otherwise, we risk changing existing build behavior for version ranges in very bad ways.
          Hide
          Benjamin Bentmann added a comment - - edited

          Fixed in r932128.

          In conformance with the fix for MNG-3092, snapshot repositories are now considered if any boundary of the version range explicitly refers to a snapshot.

          Show
          Benjamin Bentmann added a comment - - edited Fixed in r932128 . In conformance with the fix for MNG-3092 , snapshot repositories are now considered if any boundary of the version range explicitly refers to a snapshot.

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Mark Hobson
            • Votes:
              7 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: