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

update-versions goal does not update dependency versions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.4.2
    • None
    • update-versions
    • None

    Description

      When you run 'prepare-with-pom' goal, it will update snapshot version number on dependencies.

      Contrary to that behavior, update-versions, will only update parent's version.

      If you have these poms:

      aggregator-pom.xml
      <artifactId>aggregator</artifactId>
      
      <parent>
        <groupId>my.group.id</groupId>
        <artifactId>parent</artifactId>
        <version>1.0-SNAPSHOT</version>
        <relativePath>parent/pom.xml</relativePath>
      </parent>
      
      <modules>
        <module>dependent</module>
        <module>dependency</module>
      </modules>
      
      dependent-pom.xml
      <artifactId>dependent</artifactId>
      
      <parent>
        <groupId>my.group.id</groupId>
        <artifactId>parent</artifactId>
        <version>1.0-SNAPSHOT</version>
        <relativePath>../parent/pom.xml</relativePath>
      </parent>
      
      <dependencies>
        <dependency>
          <groupId>my.group.id</groupId>
          <artifactId>dependency</artifactId>
          <version>1.0-SNAPSHOT</version>
        </dependency>
      </dependencies>
      

      Then, when you run

      mvn -DdevelopmentVersion=1.1-SNAPSHOT -DautoVersionSubmodules=true release:update-versions
      

      The dependent-pom.xml will be incorrect:

      dependent-pom-1.1.xml
      <artifactId>dependent</artifactId>
      
      <parent>
        <groupId>my.group.id</groupId>
        <artifactId>parent</artifactId>
        <version>1.1-SNAPSHOT</version>
        <relativePath>../parent/pom.xml</relativePath>
      </parent>
      
      <dependencies>
        <dependency>
          <groupId>my.group.id</groupId>
          <artifactId>dependency</artifactId>
          <version>1.0-SNAPSHOT</version>
        </dependency>
      </dependencies>
      

      Notice that dependency's version is still 1.0-SNAPSHOT
      If I were to do release:prepare and release:perform the version would have been updated in both places to 1.1-SNAPSHOT
      I expect the same behavior for release:update-versions as well.

      Just to state: I cannot use ${project.version}. And custom version property does not work because of MRELEASE-782

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              alex-pub.codehaus@reflexion.net Alex Pogrebnyak
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: