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); }); }