[
http://jira.codehaus.org/browse/MNG-1943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=135184#action_135184
]
Nate Good commented on MNG-1943:
--------------------------------
I have just experienced this issue in a more critical use case. Here are the
details. Please let me know if you need more information.
${buildVersion} is a property defined in a profile in settings.xml and is used
in all poms.
<parent>
<artifactId>bar</artifactId>
<groupId>foo.bar</groupId>
<version>${buildVersion}</version>
</parent>
It seems that the problem presents itself when a project depends on an artifact
that has a parent with a non-literal value; and the parent pom is not located
on the filesystem.
Example:
pom.xml - This is the master pom that all others inherit from
Project A
pom.xml - Inherits from master pom
A.x
pom.xml - inherits from ProjectA/pom.xml
Project B
pom.xml - depends on A.x
if you run maven on ProjectB and A.x is located in a remote repository it will
fail because ${buildVersion} in A.x/pom.xml will not be interpolated before it
is used to lookup the pom.
Here is the resulting stack trace (from version 2.0.9):
Caused by: org.apache.maven.project.ProjectBuildingException:
Cannot find parent: foo.bar:xyz-pom for project:
foo.bar:prompting-client:jar:${buildVersion} for project
foo.bar:zyx-client:jar:${buildVersion}
at
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1370)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:821)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:253)
at
org.apache.maven.project.artifact.MavenMetadataSource.retrieve(MavenMetadataSource.java:106)
Is this scheduled to be fixed in the next maven release?
> MavenProject::getParent() returns a MavenProject that is NOT interpolated
> -------------------------------------------------------------------------
>
> Key: MNG-1943
> URL: http://jira.codehaus.org/browse/MNG-1943
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Reporter: John Allen
> Priority: Blocker
> Fix For: 2.1
>
> Attachments: mng-1943-test.zip
>
>
> Plugin developers repeatedly use ${project}.getParent().someMethod() yet
> getParent() returns a project that has not been interpolated. This obviously
> needs to be fixed but may I also suggest that all plugin acceptance testing
> is revisted to ensure that the tests use POMs that are littered with property
> expressions and not literals.
--
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