Skip to content

Commit 183a206

Browse files
committed
spring-boot-2684 loader: archive main class should fall back to Main-Class attribute if the Start-Class attribute is unavailable
1 parent e1a216e commit 183a206

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ protected String getMainClass() throws Exception {
5858
String mainClass = null;
5959
if (manifest != null) {
6060
mainClass = manifest.getMainAttributes().getValue("Start-Class");
61+
if (mainClass == null) {
62+
mainClass = manifest.getMainAttributes().getValue("Main-Class");
63+
}
6164
}
6265
if (mainClass == null) {
6366
throw new IllegalStateException(
64-
"No 'Start-Class' manifest entry specified in " + this);
67+
"No 'Start-Class' or 'Main-Class' manifest entry specified in " + this);
6568
}
6669
return mainClass;
6770
}

0 commit comments

Comments
 (0)