mirror of https://github.com/apache/maven.git
Fix: MNG2339b - If \$\{version} is not specified as a system or environment variable, then it is aliased as \$\{project.version} so that it will be interpolated.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@695114 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
38b9c5c25b
commit
5d266e85ba
|
@ -542,6 +542,20 @@ public final class PomClassicTransformer
|
|||
return domainModel.getModel();
|
||||
}
|
||||
|
||||
private static boolean containsProjectVersion( List<InterpolatorProperty> interpolatorProperties )
|
||||
{
|
||||
InterpolatorProperty versionInterpolatorProperty =
|
||||
new ModelProperty( ProjectUri.version, "").asInterpolatorProperty( ProjectUri.baseUri);
|
||||
for( InterpolatorProperty ip : interpolatorProperties)
|
||||
{
|
||||
if ( ip.equals( versionInterpolatorProperty ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void interpolateModelProperties(List<ModelProperty> modelProperties,
|
||||
List<InterpolatorProperty> interpolatorProperties,
|
||||
PomClassicDomainModel domainModel)
|
||||
|
@ -551,6 +565,11 @@ public final class PomClassicTransformer
|
|||
Map<String, String> aliases = new HashMap<String, String>();
|
||||
aliases.put( "project.", "pom.");
|
||||
|
||||
if(!containsProjectVersion(interpolatorProperties))
|
||||
{
|
||||
aliases.put("\\$\\{project.version\\}", "\\$\\{version\\}");
|
||||
}
|
||||
|
||||
List<ModelProperty> firstPassModelProperties = new ArrayList<ModelProperty>();
|
||||
List<ModelProperty> secondPassModelProperties = new ArrayList<ModelProperty>();
|
||||
|
||||
|
|
Loading…
Reference in New Issue