File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ public abstract class Archive {
43
43
44
44
/**
45
45
* Obtain the main class that should be used to launch the application. By default
46
- * this method uses a {@code Start-Class} manifest entry.
46
+ * this method uses a {@code Start-Class} manifest entry and falls back
47
+ * to {@code Main-Class} if the former is not found.
47
48
* @return the main class
48
49
* @throws Exception
49
50
*/
@@ -52,10 +53,13 @@ public String getMainClass() throws Exception {
52
53
String mainClass = null ;
53
54
if (manifest != null ) {
54
55
mainClass = manifest .getMainAttributes ().getValue ("Start-Class" );
56
+ if (mainClass == null ) {
57
+ mainClass = manifest .getMainAttributes ().getValue ("Main-Class" );
58
+ }
55
59
}
56
60
if (mainClass == null ) {
57
61
throw new IllegalStateException (
58
- "No 'Start-Class' manifest entry specified in " + this );
62
+ "No 'Start-Class' nor 'Main-Class' manifest entry specified in " + this );
59
63
}
60
64
return mainClass ;
61
65
}
You can’t perform that action at this time.
0 commit comments