Description
With thanks to @jjohannes:
This is about the
CreateBootStartScripts
task and Gradle 6.4:
The task subclassesCreateStartScripts
to make themainClassName
ofCreateStartScripts
optional. 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):
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’sCreateStartScripts
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.