Skip to content

Commit 79573bd

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 79573bd

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
@@ -53,9 +53,12 @@ public String getMainClass() throws Exception {
5353
if (manifest != null) {
5454
mainClass = manifest.getMainAttributes().getValue("Start-Class");
5555
}
56+
if (manifest != null) {
57+
mainClass = manifest.getMainAttributes().getValue("Main-Class");
58+
}
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)