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:
John Dennis Casey 2005-11-03 21:17:07 +00:00
parent c63c860065
commit 154fa37604
1 changed files with 11 additions and 0 deletions

View File

@ -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() );