With thanks to @jjohannes:

This is about the CreateBootStartScripts task and Gradle 6.4: The task subclasses CreateStartScripts to make the mainClassName of CreateStartScriptsoptional. 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 mainClass which is correctly marked as @Optional. mainClassName will become @Internal as it is backed by the new property. Now if you run spring boot’s :bootStartsScripts with 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 CreateBootStartScripts subclass anymore and can use Gradle’s CreateStartScripts directly 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.