Permalink
Browse files

Merge pull request #2 from nawroth/master

Bug fix, makes it not try to remove non-existent dires
  • Loading branch information...
2 parents 128f18e + 483ff71 commit 4fdb15153b11aabf70a962dbfef46b4240ba5b63 @nawroth nawroth committed Feb 27, 2012
Showing with 16 additions and 12 deletions.
  1. +16 −12 src/main/java/org/neo4j/build/plugins/docs/DocsAssembler.java
@@ -66,8 +66,8 @@
// as defined in
// org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering
- NON_FILTERED_FILE_EXTENSIONS = Arrays.asList( "tiff",
- "tif", "pdf", "zip", "gz" );
+ NON_FILTERED_FILE_EXTENSIONS = Arrays.asList( "tiff", "tif", "pdf",
+ "zip", "gz" );
}
public DocsAssembler( final List<String> sourceDirectories,
@@ -86,7 +86,7 @@ public DocsAssembler( final List<String> sourceDirectories,
public File doAssembly() throws MojoExecutionException
{
- log.info( "Filtering is: " + (filter ? "on" : "off") );
+ log.info( "Filtering is: " + ( filter ? "on" : "off" ) );
List<File> dirs = getDirectories( sourceDirectories );
if ( dirs.size() == 0 )
{
@@ -99,15 +99,18 @@ public File doAssembly() throws MojoExecutionException
{
File target = new File( new File( project.getBuild()
.getDirectory() ), "filtered-docs" );
- try
+ if ( target.exists() )
{
- FileUtils.cleanDirectory( target );
- }
- catch ( IOException e )
- {
- log.error( e );
- throw new MojoExecutionException(
- "Could not remove old filtered files.", e );
+ try
+ {
+ FileUtils.cleanDirectory( target );
+ }
+ catch ( IOException e )
+ {
+ log.error( e );
+ throw new MojoExecutionException(
+ "Could not remove old filtered files.", e );
+ }
}
filterResources( dirs, target );
destinationFile = createArchive( Collections.singletonList( target ) );
@@ -117,7 +120,8 @@ public File doAssembly() throws MojoExecutionException
destinationFile = createArchive( dirs );
}
- projectHelper.attachArtifact( project, TYPE, CLASSIFIER, destinationFile );
+ projectHelper.attachArtifact( project, TYPE, CLASSIFIER,
+ destinationFile );
return destinationFile;
}

0 comments on commit 4fdb151

Please sign in to comment.