diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java index 674657c992..93160c274d 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java @@ -373,7 +373,7 @@ public class DefaultPluginManager { if ( parameter.getDefaultValue() != null ) { - value = parameter.getDefaultValue(); + value = PluginParameterExpressionEvaluator.evaluate( parameter.getDefaultValue(), session ); } } diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java index a4dc367582..8edd0fc26d 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java @@ -34,6 +34,11 @@ public class PluginParameterExpressionEvaluator { Object value = null; + if ( expression == null ) + { + // todo : verify if it's fixed with trygvis modification in Plexus + return null; + } if ( expression.startsWith( "#component" ) ) { String role = expression.substring( 11 ); @@ -114,6 +119,22 @@ public class PluginParameterExpressionEvaluator value = System.getProperty( expression.substring( 1 ) ); } + if ( value instanceof String ) + { + String val = (String) value; + int sharpSeparator = val.indexOf( "#" ); + + if ( sharpSeparator > 0 ) + { + val = val.substring( 0, sharpSeparator ) + evaluate( val.substring( sharpSeparator ), context ); + value = val; + } + else if ( sharpSeparator > 0 ) + { + value = evaluate( val.substring( sharpSeparator ), context ); + } + } + // ---------------------------------------------------------------------- // If we strike and we are not dealing with an expression then we will // will let the value pass through unaltered so that users can hardcode