Merge branch '4.0.x' into 4.1.x

Closes gh-50959
This commit is contained in:
Stéphane Nicoll
2026-07-16 11:09:08 +02:00
@@ -71,8 +71,9 @@ public class FindMainClass extends Task {
if (this.classesRoot.isDirectory()) {
return MainClassFinder.findSingleMainClass(this.classesRoot, SPRING_BOOT_APPLICATION_CLASS_NAME);
}
return MainClassFinder.findSingleMainClass(new JarFile(this.classesRoot), "/",
SPRING_BOOT_APPLICATION_CLASS_NAME);
try (JarFile jarFile = new JarFile(this.classesRoot)) {
return MainClassFinder.findSingleMainClass(jarFile, "/", SPRING_BOOT_APPLICATION_CLASS_NAME);
}
}
catch (IOException ex) {
throw new BuildException(ex);