mirror of https://github.com/apache/maven.git
- Allow recursive evaluation
- Allow evaluation for default value git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163446 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
90ab124653
commit
6211437619
|
@ -373,7 +373,7 @@ public class DefaultPluginManager
|
||||||
{
|
{
|
||||||
if ( parameter.getDefaultValue() != null )
|
if ( parameter.getDefaultValue() != null )
|
||||||
{
|
{
|
||||||
value = parameter.getDefaultValue();
|
value = PluginParameterExpressionEvaluator.evaluate( parameter.getDefaultValue(), session );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,11 @@ public class PluginParameterExpressionEvaluator
|
||||||
{
|
{
|
||||||
Object value = null;
|
Object value = null;
|
||||||
|
|
||||||
|
if ( expression == null )
|
||||||
|
{
|
||||||
|
// todo : verify if it's fixed with trygvis modification in Plexus
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if ( expression.startsWith( "#component" ) )
|
if ( expression.startsWith( "#component" ) )
|
||||||
{
|
{
|
||||||
String role = expression.substring( 11 );
|
String role = expression.substring( 11 );
|
||||||
|
@ -114,6 +119,22 @@ public class PluginParameterExpressionEvaluator
|
||||||
value = System.getProperty( expression.substring( 1 ) );
|
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
|
// 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
|
// will let the value pass through unaltered so that users can hardcode
|
||||||
|
|
Loading…
Reference in New Issue