Browse Source

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
pull/26861/head
Phillip Webb 5 years ago
parent
commit
703eaa71f4
  1. 9
      spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java

9
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 { @@ -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);
});
}

Loading…
Cancel
Save