Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wilkinsona opened this issue Apr 1, 2020 · 1 comment
Closed
Assignees
Labels
type: bug A general bug
Milestone

Comments

@wilkinsona
Copy link
Member

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.

@wilkinsona wilkinsona added the type: bug A general bug label Apr 1, 2020
@wilkinsona wilkinsona added this to the 2.2.x milestone Apr 1, 2020
@wilkinsona
Copy link
Member Author

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.

@wilkinsona wilkinsona self-assigned this Apr 27, 2020
wilkinsona added a commit that referenced this issue May 6, 2020
The warnings will be addressed by gh-20759. CreateBootStartScripts
must be excluded from the classes that are validated by the
ValidatePlugins task. It is invalid, but only for Gradle 6.4. gh-20759
will cause it to only be used with Gradle 6.3 and earlier.

See gh-21329
@snicoll snicoll modified the milestones: 2.2.x, 2.2.7 May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants