Maven Clean now deletes '' directories if it finds any. Furthermore, AsynchronousFileCacheBackingTestSupport now not just deletes directory contents but also removes the empty corresponding directories afterwards. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>tags/V1_9_7_M2
@@ -222,7 +222,10 @@ | |||
<fileset> | |||
<directory>.</directory> | |||
<includes> | |||
<!-- AspectJ core dumps --> | |||
<include>**/ajcore.*.txt</include> | |||
<!-- Test temp-dirs in 'weaver' module, see AsynchronousFileCacheBackingTestSupport.getCacheDir --> | |||
<include>**/dir-0.*/**</include> | |||
</includes> | |||
<followSymlinks>false</followSymlinks> | |||
</fileset> |
@@ -59,14 +59,17 @@ public abstract class AsynchronousFileCacheBackingTestSupport | |||
protected void cleanupCache() { | |||
if (indexFile != null) { | |||
if (FileUtil.deleteContents(indexFile) > 0) { | |||
System.out.println("Deleted " + indexFile); | |||
System.out.println("Deleted index file: " + indexFile); | |||
} | |||
indexFile = null; | |||
} | |||
if (cacheDir != null) { | |||
if (FileUtil.deleteContents(cacheDir) > 0) { | |||
System.out.println("Deleted " + cacheDir); | |||
System.out.println("Deleted cache directory content: " + cacheDir); | |||
} | |||
if (cacheDir.delete()) { | |||
System.out.println("Deleted cache directory: " + cacheDir); | |||
} | |||
cacheDir = null; | |||
} |