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

version ranges are not resolved from snapshot only repositories

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.0.10, 2.1.0-M1, 2.1.0, 2.2.0, 2.2.1
    • None
    • None

    Description

      If a repository is defined like:

      <repositories>
      <repository>
      <id>...</id>
      <name>...</name>
      <url>....</url>
      <releases>
      <enabled>false</enabled>
      </releases>
      </repository>
      </repositories>

      Then the following call chain results with no versions being resolved from this repository

      We ask the ArtifactMetadataSource to give us a list of available versions... that is this method:

      http://maven.apache.org/ref/current/xref/org/apache/maven/project/artifact/MavenMetadataSource.html#495

      This method creates a RepositoryMetadata object of type:

      http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.html#31

      This metadata object is passed to the RepositoryMetadataManager:

      http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.html#58

      Which asks the RepositoryMetadata object if it is a snapshot...

      http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.html#69

      but our metadata object can never be a snapshot:

      http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.html#81

      So the end result is that we never look in non-release repositories...

      To verify, run the attached test case like so

      mvn clean verify -Dusernum=2

      This will fail as the repository is disabled for releases, while

      mvn clean verify -Dusernum=3

      Will pass, the only change being that the remote repository is now enabled for releases

      Attachments

        1. mversions-19.tar.gz
          2 kB
          stephenconnolly

        Issue Links

          Activity

            People

              bentmann Benjamin Bentmann
              stephenc Stephen Connolly
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: