From 78aa1f187955464ecd839d8886264470a7d25192 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Thu, 31 May 2007 19:59:38 +0000 Subject: [PATCH] MNG-2347 MavenExecutionRequest.getBaseDirectory() should be propagated to the ${basedir} expression Submitted by: Ovidio Mallo git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@543240 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugin/PluginParameterExpressionEvaluator.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 211710aaad..d614d9901c 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 @@ -106,6 +106,11 @@ public class PluginParameterExpressionEvaluator } } + if ( basedir == null && context != null ) + { + basedir = context.getExecutionRootDirectory(); + } + if ( basedir == null ) { basedir = System.getProperty( "user.dir" ); @@ -404,6 +409,10 @@ public class PluginParameterExpressionEvaluator { basedir = project.getFile().getParentFile(); } + else if ( context != null && context.getExecutionRootDirectory() != null ) + { + basedir = new File( context.getExecutionRootDirectory() ).getAbsoluteFile(); + } else { basedir = new File( "." ).getAbsoluteFile().getParentFile();