Fix: IT0141

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@705183 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2008-10-16 09:16:15 +00:00
parent bedc1d7a2b
commit 360954e6bc
1 changed files with 22 additions and 6 deletions

View File

@ -573,17 +573,33 @@ public final class PomClassicTransformer
return false; return false;
} }
private static void putProjectAliasIn(Map<String, String> map, String s)
{
map.put( "\\$\\{project." + s + "\\}", "\\$\\{" + s + "\\}");
}
private static Map<String, String> aliases = new HashMap<String, String>();
static
{
aliases.put( "project.", "pom.");
aliases.put( "\\$\\{project.build.", "\\$\\{build.");
List<String> aliasList = Arrays.asList("artifactId", "groupId", "version", "packaging", "name", "description",
"url", "inceptionYear", "scm.url", "ciManagement.url", "distributionManagement.repository.name",
"reporting.outputDirectory", "parent.groupId", "parent.artifactId",
"parent.version", "prerequisites.maven", "issueManagement.url", "organization.name");
for(String alias : aliasList) {
putProjectAliasIn(aliases, alias);
}
}
private static void interpolateModelProperties(List<ModelProperty> modelProperties, private static void interpolateModelProperties(List<ModelProperty> modelProperties,
List<InterpolatorProperty> interpolatorProperties, List<InterpolatorProperty> interpolatorProperties,
PomClassicDomainModel domainModel) PomClassicDomainModel domainModel)
throws IOException throws IOException
{ {
Map<String, String> aliases = new HashMap<String, String>();
aliases.put( "project.", "pom.");
aliases.put( "\\$\\{project.build.", "\\$\\{build.");
aliases.put( "\\$\\{project.parent.", "\\$\\{parent.");
if(!containsProjectVersion(interpolatorProperties)) if(!containsProjectVersion(interpolatorProperties))
{ {
aliases.put("\\$\\{project.version\\}", "\\$\\{version\\}"); aliases.put("\\$\\{project.version\\}", "\\$\\{version\\}");