From 703eaa71f474302932c63b6dba6e8bc932faaa0f Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 8 Jun 2021 18:00:50 -0700 Subject: [PATCH] Remove main class configuration fallback Remove fallback code since we now require Gradle 6.8 and can depend on the `getMainClass` method being present. Closes gh-26794 --- .../boot/gradle/plugin/JavaPluginAction.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java index 4b09549826..2ab46db58e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java @@ -151,14 +151,7 @@ final class JavaPluginAction implements PluginApplicationAction { } return Collections.emptyList(); }); - try { - run.getMainClass().convention(resolveProvider.flatMap(ResolveMainClassName::readMainClassName)); - } - catch (NoSuchMethodError ex) { - run.getInputs().file(resolveProvider.map((task) -> task.getOutputFile())); - run.conventionMapping("main", - () -> resolveProvider.flatMap(ResolveMainClassName::readMainClassName).get()); - } + run.getMainClass().convention(resolveProvider.flatMap(ResolveMainClassName::readMainClassName)); configureToolchainConvention(project, run); }); }