diff --git a/maven-mboot2/src/main/java/FileUtils.java b/maven-mboot2/src/main/java/FileUtils.java index d755b33389..3cdec43cf6 100644 --- a/maven-mboot2/src/main/java/FileUtils.java +++ b/maven-mboot2/src/main/java/FileUtils.java @@ -912,6 +912,11 @@ public class FileUtils public static void forceDelete( final File file ) throws IOException { + if ( ! file.exists() ) + { + return; + } + if ( file.isDirectory() ) { deleteDirectory( file ); @@ -934,6 +939,11 @@ public class FileUtils public static void forceDeleteOnExit( final File file ) throws IOException { + if ( ! file.exists() ) + { + return; + } + if ( file.isDirectory() ) { deleteDirectoryOnExit( file ); diff --git a/maven-mboot2/src/main/java/MBoot.java b/maven-mboot2/src/main/java/MBoot.java index a8974c33da..a7d5fc66d9 100644 --- a/maven-mboot2/src/main/java/MBoot.java +++ b/maven-mboot2/src/main/java/MBoot.java @@ -402,10 +402,7 @@ public class MBoot // clean System.out.println( "Cleaning " + buildDirFile + "..." ); - if ( buildDirFile.exists() ) - { - FileUtils.forceDelete( buildDirFile ); - } + FileUtils.forceDelete( buildDirFile ); // ---------------------------------------------------------------------- // Download deps