diff --git a/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/JarFileRemoteApplicationLauncher.java b/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/JarFileRemoteApplicationLauncher.java index 8007298ed5..2ee627b7a2 100644 --- a/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/JarFileRemoteApplicationLauncher.java +++ b/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/JarFileRemoteApplicationLauncher.java @@ -72,7 +72,13 @@ public class JarFileRemoteApplicationLauncher extends RemoteApplicationLauncher file.getAbsolutePath().substring(root.getAbsolutePath().length() + 1) .replace("\\", "/") + (file.isDirectory() ? "/" : ""))); if (file.isFile()) { - StreamUtils.copy(new FileInputStream(file), output); + FileInputStream input = new FileInputStream(file); + try { + StreamUtils.copy(input, output); + } + finally { + input.close(); + } } output.closeEntry(); }