You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org> on 2010/02/27 18:50:55 UTC

[jira] Closed: (MNG-4573) ${project.parent.groupId} not resolved properly in dependency management section

     [ http://jira.codehaus.org/browse/MNG-4573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MNG-4573.
----------------------------------

    Resolution: Cannot Reproduce
      Assignee: Benjamin Bentmann

Running "mvn help:effective-pom" on the parent module yields:
{noformat}
<!-- ====================================================================== -->
<!--                                                                        -->
<!-- Effective POM for project 'bug.mvn.sub:parent:pom:1.0'                 -->
<!--                                                                        -->
<!-- ====================================================================== -->
...
      <dependency>
        <groupId>bug.mvn</groupId>
        <artifactId>relative</artifactId>
        <version>1.0</version>
      </dependency>
...
<!-- ====================================================================== -->
<!--                                                                        -->
<!-- Effective POM for project 'bug.mvn.sub:child:jar:1.0'                  -->
<!--                                                                        -->
<!-- ====================================================================== -->
...
      <dependency>
        <groupId>bug.mvn.sub</groupId>
        <artifactId>relative</artifactId>
        <version>1.0</version>
      </dependency>
...
{noformat}
Note that this command outputs two effective models, having different groupIds for the managed dependency. Both models are correctly built as the expression {{project.parent.groupId}} (like any other POM expression) gets evaluated in the context of the current project and inheritance (by design) occurs before interpolation. In other words, the child module inherits the managed dependency in uninterpolated form and then resolves the expression from its own model, not the model of the parent.

> ${project.parent.groupId} not resolved properly in dependency management section
> --------------------------------------------------------------------------------
>
>                 Key: MNG-4573
>                 URL: http://jira.codehaus.org/browse/MNG-4573
>             Project: Maven 2 & 3
>          Issue Type: Bug
>    Affects Versions: 2.2.1
>         Environment: windows, jdk6u18
>            Reporter: hatchetman82
>            Assignee: Benjamin Bentmann
>            Priority: Minor
>         Attachments: grandparent.zip
>
>
> ${project.parent.groupId} in dependency management is resolved to ${project.groupId}
> this is demonstrated in the maven project i've attached, simply browse over to the "parent" module (child module of "grandparent") and issue the following command: "mvn help:effective-pom"
> this would reveal that
> 			
> <dependency>
>    <groupId>${project.parent.groupId}</groupId>
>    <artifactId>relative</artifactId>
>    <version>1.0</version>
> </dependency>
> was translated into
> <dependency>
>    <groupId>bug.mvn.sub</groupId>
>    <artifactId>relative</artifactId>
>    <version>1.0</version>
> </dependency>
> but module "grandparent" has a groupId of "bug.mvn"

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira