You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mk...@apache.org on 2008/01/11 08:37:17 UTC
svn commit: r611091 -
/maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java
Author: mkleint
Date: Thu Jan 10 23:37:16 2008
New Revision: 611091
URL: http://svn.apache.org/viewvc?rev=611091&view=rev
Log:
MRESOURCES-32 always make resources root absolute.
Modified:
maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java
Modified: maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java?rev=611091&r1=611090&r2=611091&view=diff
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java (original)
+++ maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java Thu Jan 10 23:37:16 2008
@@ -118,6 +118,10 @@
String targetPath = resource.getTargetPath();
File resourceDirectory = new File( resource.getDirectory() );
+ if ( !resourceDirectory.isAbsolute() )
+ {
+ resourceDirectory = new File( project.getBasedir(), resourceDirectory.getPath() );
+ }
if ( !resourceDirectory.exists() )
{
@@ -138,7 +142,7 @@
DirectoryScanner scanner = new DirectoryScanner();
- scanner.setBasedir( resource.getDirectory() );
+ scanner.setBasedir( resourceDirectory );
if ( resource.getIncludes() != null && !resource.getIncludes().isEmpty() )
{
scanner.setIncludes( (String[]) resource.getIncludes().toArray( EMPTY_STRING_ARRAY ) );
@@ -173,7 +177,7 @@
destination = targetPath + "/" + name;
}
- File source = new File( resource.getDirectory(), name );
+ File source = new File( resourceDirectory, name );
File destinationFile = new File( outputDirectory, destination );