With thanks to @jjohannes:
This is about the
CreateBootStartScriptstask and Gradle 6.4: The task subclassesCreateStartScriptsto make themainClassNameofCreateStartScriptsoptional. I think the fact that it was not optional is actually a long standing bug in Gradle (it was marked with Nullable already). So what you did there back then was a good workaround.In Gradle 6.4, there will be a new property, using the lazy configuration API, called
mainClasswhich is correctly marked as@Optional.mainClassNamewill become@Internalas it is backed by the new property. Now if you run spring boot’s:bootStartsScriptswith 6.4 you will see a warning (you can see this with the current nightly):
Task :bootStartScripts
Property 'mainClassName' is annotated with @Optional that is not allowed for @Internal properties.
I think you do not need the
CreateBootStartScriptssubclass anymore and can use Gradle’sCreateStartScriptsdirectly with 6.4. You could do a Gradle version check and decide which task implementation to use. You can also keep this around for now and live with the warning until you decide to drop support for 5.x.
Comment From: wilkinsona
I think we should go with a version check and use CreateBootStartScripts with Gradle 6.3 and earlier and CreateStartScripts with Gradle 6.4 and later.