From 6121d105fc56c57636b98ecc7504caff978bcd14 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 5 Apr 2016 16:30:50 +0100 Subject: [PATCH] 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 --- .../main/java/org/springframework/boot/loader/JarLauncher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/JarLauncher.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/JarLauncher.java index ec7b0bcdc7..2776d6f8c1 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/JarLauncher.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/JarLauncher.java @@ -44,7 +44,7 @@ public class JarLauncher extends ExecutableArchiveLauncher { @Override protected boolean isNestedArchive(Archive.Entry entry) { if (entry.isDirectory()) { - return entry.getName().startsWith(BOOT_INF_CLASSES); + return entry.getName().equals(BOOT_INF_CLASSES); } return entry.getName().startsWith(BOOT_INF_LIB); }