Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Bug fix, makes it not try to remove non-existent dires #2

Merged
merged 1 commit into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 12 deletions.
  1. +16 −12 src/main/java/org/neo4j/build/plugins/docs/DocsAssembler.java
View
28 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;
}
Something went wrong with that request. Please try again.