[
https://issues.apache.org/jira/browse/MNG-5900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15223200#comment-15223200
]
Robert Scholte commented on MNG-5900:
-------------------------------------
Only if there's a usecase for it. I cannot think of one where the project is
interested in the value of one if its supers (which is different compared to
the current one).
MNG-5763 is a pretty good example when to use {{this}}. The most important
thing is to explain when to use {{this}}. It is about having a property for
something which is used multiple times within this pom.xml, but you don't want
to overridden by any project using it as a parent.
{code:xml}
<packaging>pom</packaging>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>someArtifactId</artifactId>
</dependency>
{code}
If a different project using this as its parent, but has a different groupId,
then the dependency cannot be found. Here you need early interpolation.
this.groupId will do the trick.
I don't expect {{this}} to be used very much, but in some edgecases it is the
only solution.
> early interpolation: support ${this.*} as expression
> ----------------------------------------------------
>
> Key: MNG-5900
> URL: https://issues.apache.org/jira/browse/MNG-5900
> Project: Maven
> Issue Type: New Feature
> Components: Inheritance and Interpolation
> Reporter: Robert Scholte
> Fix For: Issues to be reviewed for 4.x
>
>
> Right now we have $\{project.\*} which always interpolates values based on
> the final project: "classical" interpolation is "late" interpolation. So it
> is not possible that parent poms can lock values, ie avoid child poms
> override. By adding $\{this} for "early" interpolation, it will be possible
> to have intermediate interpolation.
> If a pomfile depends on a parent, that parent will first resolve all
> $\{this.\*} values for itself. Once the fully inherited pom is there, all
> $\{project.\*} will be resolved.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)