A task must not use any Project objects at execution time. This includes calling Task.getProject() while the task is running.
See https://docs.gradle.org/7.0/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
Fix GH-39635
Comment From: wilkinsona
Thanks, @quaff. Can you please revert the changes within buildSrc? They're unrelated to #39635 as they'll only affect Boot's own build. Fixing that is a much bigger piece of work being tracked by #32980.
Comment From: quaff
Thanks, @quaff. Can you please revert the changes within
buildSrc? They're unrelated to #39635 as they'll only affect Boot's own build. Fixing that is a much bigger piece of work being tracked by #32980.
Done.
Comment From: wilkinsona
For merge with amendments as I'd like to see if we can test this.
Comment From: wilkinsona
We already appear to have tests for this as both BootRunIntegrationTests and BootJarIntegrationTests run with the configuration cache enabled and have tests that rely on resolution of the main class name. I've also tried and failed to reproduce the problem described in #39635 using a basic project generated from start.spring.io. As such, I don't think we can merge this as we don't know if the change is necessary and, more importantly, we don't know if it'll fix the reported problem. I'll leave it on hold for now until we make some progress on understanding the underlying problem.
Comment From: wilkinsona
Thanks again for the PR, @quaff, but I've decided to take a different approach here. Please see #40463.