From 5da31aca461d2580d890f60fb23e55933daabdf9 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 6 Oct 2023 21:47:55 -0700 Subject: [PATCH] Attempt to fix NestedJarFile file lock issues on Windows Update `NestedJarFile.close()` to call `super.close()` so that the outer jar file is closed and files can hopefully be deleted on Windows. See gh-37668 --- .../java/org/springframework/boot/loader/jar/NestedJarFile.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/NestedJarFile.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/NestedJarFile.java index b3de537026..2fe35c46c1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/NestedJarFile.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/NestedJarFile.java @@ -373,6 +373,7 @@ public class NestedJarFile extends JarFile { @Override public void close() throws IOException { + super.close(); if (this.closed) { return; }