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

${revision} and parent.releativePath

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 3.5.3
    • None
    • None
    • None
    • Ubuntu 17.10; Maven 3.5.3; Java 1.8.0_161

    Description

      If the CI friendly ${revision} property is used it seems maven does not simple replace the property with the given value.

      Consider the following example:

      parent-project/
          pom.xml
      child-project/
          pom.xml

      parent-project/pom.xml:
      ...
          <groupId>my.group</groupId>
          <artifactId>parentArtifact</artifactId>
          <version>${revision}</version>
          <packaging>pom</packaging>
      ...

      child-project/pom.xml:
      <parent>
      <groupId>my.group</groupId>
      <artifactId>parentArtifact</artifactId>
      <version>${revision}</version>
      <relativePath>../parent-project</relativePath>
      </parent>

      If you build the child-project with 'mvn -Drevision=1.0.0-SNAPSHOT -f child-project/pom.xml clean install' all works fine as long as the parent project is present in the file system. But if you move the parent project to another place, build & install it to your local repository and then try to build the child project, maven tries to download the pom.xml of the parent project but does not replace ${revision}. So maven complains about a missing dependency.

      Attachments

        1. test-projects.jar
          2 kB
          Dorian Vallant
        2. test-projects.jar
          2 kB
          Dorian Vallant
        3. test-projects-flatten.jar
          2 kB
          Dorian Vallant

        Activity

          People

            khmarbaise Karl Heinz Marbaise
            dallant Dorian Vallant
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: