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

ReleaseFailureException of an artifact with version as a property

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.5.1, 2.5.3
    • None
    • prepare
    • Maven 3.2.1
      Windows 7
      Intel Core i7

    Description

      After updating the release maven plugin from version 2.0.0 to 2.5.1, I've got the following exception:

      message : Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.1:prepare (default-cli) on project ping-parent: The artifact (com.mycompagny.myapp:myapp-client) requires a different version (15.4.0) than what is found (12.2.1) for the expression (version.client.tested) in the project (com.mycompagny.myapp:myapp-client).
      cause : The artifact (com.mycompagny.myapp:myapp-client) requires a different version (15.4.0) than what is found (12.2.1) for the expression (version.client.tested) in the project (com.mycompagny.myapp:myapp-client).
      Stack trace : 
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.1:prepare (default-cli) on project ping-parent: The artifact (fr.generali.gael.ping:ping-injection-client) requires a different version (15.4.1-git) than what is found (15.4.0) for the expression (version.client.tested) in the project (fr.generali.gael.ping:ping-client-test).
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java
      

      This error happens in a multi-module application.
      For testing purpose, we depends from an older version of an artefact of the same application.
      When the artefact version is an expression (ie. ${version.client.tested}), the AbstractRewritePomsPhase class do a chek.
      If we don't use the expression (i.e. properties), the release is working.

      Maven configuration that fails:

      <properties>
      	<version.client.tested>12.1.0</version.client.tested>
      </properties>
      <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>myapp-client</artifactId>
            <version>${version.client.tested}</version>
      </dependency>	
      

      Maven configuration that is working:

      <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>myapp-client</artifactId>
            <version>12.1.0</version>
      </dependency>
      

      Attachments

        1. MRELEASE-932.zip
          3 kB
          Andreas Dangel

        Activity

          People

            Unassigned Unassigned
            Elryk Antoine
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: