Author: bentmann Date: Thu May 14 21:02:10 2009 New Revision: 774925 URL: http://svn.apache.org/viewvc?rev=774925&view=rev Log: o Restored basedir alignment
Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java?rev=774925&r1=774924&r2=774925&view=diff ============================================================================== --- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java (original) +++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java Thu May 14 21:02:10 2009 @@ -344,6 +344,26 @@ public File alignToBaseDirectory( File file ) { + // TODO: Copied from the DefaultInterpolator. We likely want to resurrect the PathTranslator or at least a + // similar component for re-usage + if ( file != null ) + { + if ( file.isAbsolute() ) + { + // path was already absolute, just normalize file separator and we're done + } + else if ( file.getPath().startsWith( File.separator ) ) + { + // drive-relative Windows path, don't align with project directory but with drive root + file = file.getAbsoluteFile(); + } + else + { + // an ordinary relative path, align with project directory + file = new File( new File( basedir, file.getPath() ).toURI().normalize() ).getAbsoluteFile(); + } + } return file; } + }