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

mvn release:prepare-with-pom doesn't replace SNAPSHOTs defined in a SNAPSHOT parent

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Not A Problem
    • Affects Version/s: 2.5.2, 2.5.3
    • Fix Version/s: None
    • Component/s: prepare-with-pom
    • Labels:
      None

      Description

      If I use a SNAPSHOT version of a plugin within a parent pom that is also a SNAPSHOT, the mvn release:prepare-with-pom can't replace it with its released version.
      I'm asked:

      There are still some remaining snapshot dependencies.
      : Do you want to resolve them now? (yes/no) no: : yes
      Dependency type to resolve,: specify the selection number ( 0:All 1:Project Dependencies 2:Plugins 3:Reports 4:Extensions ): (0/1/2/3) 1: : 
      Dependency 'my.group:my.dependency' is a snapshot (1.0.0-SNAPSHOT)
      : Which release version should it be set to? 1.0.0: : 
      What version should the dependency be reset to for development? 1.0.0: : 1.0.1-SNAPSHOT
      Dependency 'my.group:my.parent' is a snapshot (1.0.0-SNAPSHOT)
      : Which release version should it be set to? 1.0.0: : 
      What version should the dependency be reset to for development? 1.0.0: : 1.0.1-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 40.211s
      [INFO] Finished at: Wed Sep 23 13:35:33 CEST 2015
      [INFO] Final Memory: 17M/157M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.2:prepare-with-pom (default-cli) on project my.project: Can't release project due to non released dependencies :
      [ERROR] my.group:my.maven.plugin:maven-plugin:1.0.0-SNAPSHOT:runtime
      

      Example parent pom:

      <project>
          <groupId>my.group</groupId>
          <artifactId>my.parent</artifactId>
          <version>1.0.0-SNAPSHOT</version>
          <packaging>pom</packaging>
          <profiles>
              <profile>
                  <id>java-packaging-tools</id>
                  <activation>
                      <activeByDefault>true</activeByDefault>
                  </activation>
                  <build>
                      <plugins>
                          <plugin>
                              <groupId>my.group</groupId>
                              <artifactId>my.maven.plugin</artifactId>
                              <version>1.0.0-SNAPSHOT</version>
                          </plugin>
                      </plugins>
                  </build>
              </profile>
          </profiles>
      </project>
      

      Example project pom:

      <project>
          <groupId>my.group</groupId>
          <artifactId>my.project</artifactId>
          <version>1.0.0-SNAPSHOT</version>
          <dependencies>
              <dependency>
                  <groupId>my.group</groupId>
                  <artifactId>my.dependency</artifactId>
                  <version>1.0.0-SNAPSHOT</version>
              </dependency>
          </dependencies>
      </project>
      

      So first of all, why are the transitive dependencies resolved before the parent?
      And now the issue: in the released version of my.parent (1.0.0) there is also the released version of my.maven.plugin (1.0.0) so why is the relase:prepare-with-pom failing?
      If I manually set the parent version to 1.0.0 before I run mvn relase:prepare-with-pom everything works fine as expected.
      Also I when use the option "Dependency type to resolve,: specify the selection number ( 0:All 1:Project Dependencies 2:Plugins 3:Reports 4:Extensions ): (0/1/2/3) 1: : 0" I'm asked for the relese version of the my.maven.plugin and can perform the release as expected.

      And a last question: why is the default answer for the "What version should the dependency be reset to for development?" question always the released version and not the next SNAPSHOT version?

        Attachments

          Activity

            People

            • Assignee:
              rfscholte Robert Scholte
              Reporter:
              schaller Andreas Schaller
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: