Resource leak for maven plugin used with java eclipse formatter
After check goal of spotless maven plugin (1.24.1) configured to use java > eclipse, temporary directory is left in filesystem.
Seems that below deleteOnExit
|
private static URL createTemporaryDirectory() { |
|
try { |
|
Path locationPath = Files.createTempDirectory(TEMP_PREFIX); |
|
locationPath.toFile().deleteOnExit(); |
|
return locationPath.toUri().toURL(); |
|
} catch (IOException e) { |
|
throw new IOError(e); |
|
} |
is not enough, as directory is non-empty (contains subdirectory
org.eclipse.core.runtime), and as such is not deleted on JVM exit.
Resource leak for maven plugin used with java eclipse formatter
After
checkgoal ofspotless maven plugin(1.24.1) configured to usejava>eclipse, temporary directory is left in filesystem.Seems that below
deleteOnExitspotless/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/service/TemporaryLocation.java
Lines 43 to 50 in 6c7db83
is not enough, as directory is non-empty (contains subdirectory
org.eclipse.core.runtime), and as such is not deleted on JVM exit.