Skip to content

Fix deprecation warnings due to tasks calling getProject() at execution time #32980

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

Closed
wilkinsona opened this issue Nov 2, 2022 · 4 comments
Closed
Assignees
Labels
type: task A general task
Milestone

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Nov 2, 2022

Some of our custom tasks (org.springframework.boot.build.autoconfigure.AutoConfigurationMetadata is one) call getProject() at execution time. This results in a deprecation warning and means that our build will break with Gradle 9.0. While we won't be able to fix all such warnings in our build as some come from third-party plugins, we should update our own tasks.

@wilkinsona wilkinsona added the type: task A general task label Nov 2, 2022
@wilkinsona wilkinsona added this to the 2.6.x milestone Nov 2, 2022
@wilkinsona wilkinsona self-assigned this Nov 2, 2022
@0x100
Copy link

0x100 commented Nov 12, 2022

Hi! As far as I understood, the build should not break with Gradle 8.0. The deprecated class there is org.gradle.api.internal.AbstractTask, its removal should not affect the getProject() method.

@wilkinsona
Copy link
Member Author

The getProject() method isn't going away, but Gradle is going to prohibit/restrict calling it during task execution. That's what we want to address. To see the warnings you have to enable the STABLE_CONFIGURATION_CACHE feature preview.

@wilkinsona wilkinsona modified the milestones: 2.6.x, 2.7.x Nov 24, 2022
@ThomazPassarelli
Copy link
Contributor

Hi! I find this issue interesting. May I start working on it? Thanks in advance!

@wilkinsona
Copy link
Member Author

wilkinsona commented May 25, 2023

Thanks for the offer, @ThomazPassarelli, but I've already made a start on this (several months ago now) and just need to find some time to finish it off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

No branches or pull requests

4 participants