Skip to content

CreateBootStartScripts causes a warning to be logged with Gradle 6.4 #20759

Closed
@wilkinsona

Description

@wilkinsona

With thanks to @jjohannes:

This is about the CreateBootStartScripts task and Gradle 6.4:
The task subclasses CreateStartScripts to make the mainClassName of CreateStartScripts 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’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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions