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

Maven 3.6.1 does not resolve ${revision} if defined within parent section and when parent pom is externally sourced

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 3.6.1
    • None
    • POM

    Description

      Current Behavior

      Create a parent maven project "top" pom (corporate pom) with version "1.0.0-SNAPSHOT" like this:

       

      <groupId>com.test</groupId>
      <artifactId>top</artifactId>
      <version>${revision}</version>
      

       

      Execute the following

      mvn -Drevision=1.0.0-SNAPSHOT install

      Create another mvn project "child-repo" and provide the pom like this:

       

      <groupId>com.test</groupId>
      <artifactId>child-repo</artifactId>
      <version>${revision}</version>
      <parent>
        <groupId>com.test</groupId>
        <artifactId>top</artifactId>
        <version>${revision}</version>
        <relativePath/> 
      </parent>
      

       

       

      I get an error

      Non-resolvable parent POM for com.test:top:${revision}: Could not transfer artifact com.test:top:pom:${revision} from/to nexus ($NEXUS)URL/content/groups/public): Failed to transfer file $NEXUS_URL/com/test/top/$%7Brevision%7D/top$%7Brevision%7D.pom with status code 400 and 'parent.relativePath' points at wrong local POM @ line 12, column 10 -> 

      The only way to resolve is to also checkout the "top" project and keep at the same level as "child-repo" project and add the following to child-repo's parent section.

      <relativePath>../top</relativePath>

      Expected Result

      I would like Maven to resolve the "top" repo from the mvn repository directly instead of having it refer it via relativePath.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Divanovich Vasiliy
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: