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

In reactor projects, having a "root" counterpart to "project" properties would be useful

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Do
    • 3.3.3
    • None
    • Bootstrap & Build, Core, General
    • None

    Description

      Often, in reactor builds, modules need to refer to properties relative to the root pom. E.g.:

      root-pom.xml
      \___ module1-pom.xml
               \___ sub-module1-pom.xml
      \___ module2-pom.xml
               \___ sub-module2-pom.xml
      

      In this example, there's no way to set a dependency in the root pom that uses the root pom's parent version. This is because ${project.parent.version} will be evaluated relatively in module1/2 and sub-module1/2. In module1/2, it will refer to the root's parent. But, in sub-module1/2 it will refer only to the root.

      Ideally, we could do something like this:

      <parent>
          <groupId>my.group</groupId>
          <artifactId>foo</artifactId>
          <version>1.2.3</version>
      </parent>
      
      <dependencyManagement>
          <dependencies>
              <dependency>
                  <groupId>my.group</groupId>
                  <artifactId>a-different-artifact-in-my.group</artifactId>
                  <version>${root.parent.version}</version>
              </dependency>
          </dependencies>
      </dependencyManagement>
      

      With this "root" feature, ${root.parent.version} would refer to the same value at every level of the reactor build.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              randgalt Jordan Zimmerman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: