treat empty expressions as non-existant

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163742 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-04-01 16:14:30 +00:00
parent 49593155d0
commit 97eb92041d
1 changed files with 8 additions and 7 deletions

View File

@ -77,8 +77,8 @@ public class PluginParameterExpressionEvaluator
if ( pathSeparator > 0 ) if ( pathSeparator > 0 )
{ {
value = getValue( expression.substring( 1, pathSeparator ), context.getProject() ) value = getValue( expression.substring( 1, pathSeparator ), context.getProject() ) +
+ expression.substring( pathSeparator ); expression.substring( pathSeparator );
} }
else else
{ {
@ -87,7 +87,8 @@ public class PluginParameterExpressionEvaluator
} }
catch ( Exception e ) catch ( Exception e )
{ {
throw new PluginConfigurationException( "Error evaluating plugin parameter expression: " + expression, e ); throw new PluginConfigurationException( "Error evaluating plugin parameter expression: " + expression,
e );
} }
} }
else if ( "#settings".equals( expression ) ) else if ( "#settings".equals( expression ) )
@ -104,8 +105,8 @@ public class PluginParameterExpressionEvaluator
if ( pathSeparator > 0 ) if ( pathSeparator > 0 )
{ {
value = context.getProject().getFile().getParentFile().getAbsolutePath() value = context.getProject().getFile().getParentFile().getAbsolutePath() +
+ expression.substring( pathSeparator ); expression.substring( pathSeparator );
} }
else else
{ {
@ -147,14 +148,14 @@ public class PluginParameterExpressionEvaluator
// mojo descriptor. // mojo descriptor.
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
if ( value == null && !expression.startsWith( "#" ) ) if ( value == null && expression.length() > 0 && !expression.startsWith( "#" ) )
{ {
value = expression; value = expression;
} }
return value; return value;
} }
private static Object getValue( String expression, MavenProject project ) private static Object getValue( String expression, MavenProject project )
throws Exception throws Exception
{ {