diff --git a/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java b/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java index b32517174e..3de1ae99f2 100644 --- a/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java +++ b/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java @@ -127,6 +127,17 @@ public class ResourcesMojo continue; } + // this part is required in case the user specified "../something" as destination + // see MNG-1345 + File outputDir = new File( outputDirectory ); + if ( !outputDir.exists() ) + { + if ( !outputDir.mkdirs() ) + { + throw new MojoExecutionException( "Cannot create resource output directory: " + outputDir ); + } + } + DirectoryScanner scanner = new DirectoryScanner(); scanner.setBasedir( resource.getDirectory() );