Skip to content

Commit c3b3243

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 2105be2 commit c3b3243

File tree

1 file changed

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

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ public String getMainClass() throws Exception {
5252
String mainClass = null;
5353
if (manifest != null) {
5454
mainClass = manifest.getMainAttributes().getValue("Start-Class");
55+
if (mainClass == null) {
56+
mainClass = manifest.getMainAttributes().getValue("Main-Class");
57+
}
5558
}
5659
if (mainClass == null) {
5760
throw new IllegalStateException(
58-
"No 'Start-Class' manifest entry specified in " + this);
61+
"No 'Start-Class' nor 'Main-Class' manifest entry specified in " + this);
5962
}
6063
return mainClass;
6164
}

0 commit comments

Comments
 (0)