mirror of https://github.com/apache/maven.git
PR: MNG-1345
Submitted By: Edwin Punzalan Reviewed By: John Casey Applied Edwin's patch to create the resource-target directory if it doesn't exist. Thanks for the work, Edwin! Also, I modified this patch slightly per Jerome's suggestion, to fail with a message if outputDir.mkdirs() doesn't succeed. This is fine, since it's within the scope of !outputDir.exists(). git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@330639 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c63c860065
commit
154fa37604
|
@ -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() );
|
||||
|
|
Loading…
Reference in New Issue