Skip to content

Commit 6121d10

Browse files
committed
Update JarLauncher to filter BOOT-INF/classes correctly
Previously, JarLauncher considered any entry whose name began with BOOT-INF/classes/ as being a nested entry. This was incorrect as it meant that subdirectories of BOOT-INF/classes/ would be added to the classpath rather than just BOOT-INF/classes/ itself. This commit updates JarLauncher so that only directory entries with a name equal to BOOT-INF/classes are used. Closes gh-5610
1 parent 87de7e6 commit 6121d10

File tree

1 file changed

+1
-1
lines changed
  • spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader

1 file changed

+1
-1
lines changed

spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/JarLauncher.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected JarLauncher(Archive archive) {
4444
@Override
4545
protected boolean isNestedArchive(Archive.Entry entry) {
4646
if (entry.isDirectory()) {
47-
return entry.getName().startsWith(BOOT_INF_CLASSES);
47+
return entry.getName().equals(BOOT_INF_CLASSES);
4848
}
4949
return entry.getName().startsWith(BOOT_INF_LIB);
5050
}

0 commit comments

Comments
 (0)