Uploaded image for project: 'Maven Release Plugin'
  1. Maven Release Plugin
  2. MRELEASE-659

snapshot dependency check on preparation of release: check artifacts WITH versions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0, 2.1
    • None
    • None
    • None
    • maven 2.2.1, jdk1.6, release-plugin 2.1, preparationGoals="clean compile", goals="clean install", maven call: "clean dependency:resolve release:prepare release:perform"

    Description

      running a release on a project with the following dependency declaration:

      <dependency>
      	<groupId>abc</groupId>
      	<artifactId>myartifact</artifactId>
      	<version>1.0.0-SNAPSHOT</version>
      </dependency>
      <dependency>
      	<groupId>abc</groupId>
      	<artifactId>myartifact</artifactId>
      	<version>1.0.0</version>
      	<type>test-jar</type>
      	<scope>test</scope>
      </dependency>
      

      we all would expect the plugin to fail the release because the dependency snapshot detection should find the SNAPSHOT artifact. with further checks i found that when using "dependency:resolve" no snapshot-artifact will be found in the checking phase. i did some more analysis and think that the cause is in "org.apache.maven.shared.release.phase.CheckDependencySnapshotsPhase.checkArtifact(Artifact, Map, Map, ReleaseDescriptor)". there the artifact to check is again initialized by getting it from the "ArtifactUtils.artifactMapByVersionlessId( project.getArtifacts() )"-Map. this map, unfortunately, doesn't keep both dependencies from above. so the check fails and the release plugin wrongly succeedes.

      i guess that there is more than this pain with dependency resolution. just want to let you know. as a workaround i just skip executing the "dependency:resolve" goal while releasing.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              krulls Stephan Krull
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: