From 183a20651b9e4de52cd5dce2d5f2df5da24e4b3e Mon Sep 17 00:00:00 2001 From: Patrik Beno Date: Thu, 10 Nov 2016 12:07:52 +0100 Subject: [PATCH] spring-boot-2684 loader: archive main class should fall back to Main-Class attribute if the Start-Class attribute is unavailable --- .../boot/loader/ExecutableArchiveLauncher.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ExecutableArchiveLauncher.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ExecutableArchiveLauncher.java index 0a6a1c83f4d0..ce0af6275772 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ExecutableArchiveLauncher.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ExecutableArchiveLauncher.java @@ -58,10 +58,13 @@ protected String getMainClass() throws Exception { String mainClass = null; if (manifest != null) { mainClass = manifest.getMainAttributes().getValue("Start-Class"); + if (mainClass == null) { + mainClass = manifest.getMainAttributes().getValue("Main-Class"); + } } if (mainClass == null) { throw new IllegalStateException( - "No 'Start-Class' manifest entry specified in " + this); + "No 'Start-Class' or 'Main-Class' manifest entry specified in " + this); } return mainClass; }