Hi Shane,
Author: sisbell
Date: Tue Oct 14 02:56:13 2008
New Revision: 704423
URL: http://svn.apache.org/viewvc?rev=704423&view=rev
Log:
Fix for IT100. During interpolation, something with 'parent.' needs to be
aliased: 'project.parent.' I'm not sure that this is good behavior, given that
someone may use 'parent. in their own context.
Modified:
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java
Modified:
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java
URL:
http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java?rev=704423&r1=704422&r2=704423&view=diff
==============================================================================
---
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java
(original)
+++
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java
Tue Oct 14 02:56:13 2008
@@ -558,6 +558,7 @@
Map<String, String> aliases = new HashMap<String, String>();
aliases.put( "project.", "pom.");
aliases.put( "\\$\\{project.build.", "\\$\\{build.");
+ aliases.put( "\\$\\{project.parent.", "\\$\\{parent.");
I fear it's even more ugly than that. If you take a closer look at the
RegexBasedModelInterpolator from the 2.x branch, you will notice that
not only project.build and project.parent can be accessed without the
"project." prefix but that any POM element is interpolated without using
"pom." or "project." as prefix (see also [0]).
For this example POM
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>1.0</version>
<name>test</name>
<description>desc</description>
<url>everywhere</url>
<organization>
<name>Apache</name>
</organization>
<properties>
<prop>${groupId} ${artifactId} ${version} ${name} ${description}
${url} ${organization.name}</prop>
</properties>
</project>
one gets
<prop>foo bar 1.0 test desc everywhere Apache</prop>
from the effective POM.
Since I currently cannot imagine a use case for this aliasing, I am +1
if the next model version would simplify/restrict the interpolation
semantics to not alias project.foo with foo.
Benjamin
[0] http://docs.codehaus.org/display/MAVEN/POM+Interpolation+Refactor.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]