From fd1fd6d2858a997b2619ebe6593f11f8bcd9ad23 Mon Sep 17 00:00:00 2001 From: Hyunwoo Jung Date: Tue, 8 Sep 2026 21:54:37 +0900 Subject: [PATCH] Avoid implicit property lookup in parent projects Gradle 9.6 deprecated the implicit lookup of properties in parent projects, which currently causes the build to emit deprecation warnings and will become an error in Gradle 10. The settings script for the gradle/plugins build sets properties from the root gradle.properties file only on its root project. The cycle-detection-plugin subproject then resolves javaFormatVersion and checkstyleToolVersion by walking up to its parent, which triggers the deprecation. This commit uses GradleLifecycle#beforeProject rather than Gradle#rootProject so that the properties are defined directly on every project in the build. As an isolated action, it also avoids carrying the settings script into each project's configuration, which keeps the build friendlier to the configuration cache. It also enables the NO_IMPLICIT_LOOKUP_IN_PARENT_PROJECTS feature preview so that any reintroduction of the deprecated behavior fails the build rather than only emitting a warning. Signed-off-by: Hyunwoo Jung See gh-51625 --- gradle/plugins/settings.gradle | 4 +++- settings.gradle | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gradle/plugins/settings.gradle b/gradle/plugins/settings.gradle index c7575c020bb..8605bec54b8 100644 --- a/gradle/plugins/settings.gradle +++ b/gradle/plugins/settings.gradle @@ -20,10 +20,12 @@ pluginManagement { def properties = new Properties() properties.load(it) properties.forEach(settings.ext::set) - gradle.rootProject { + gradle.lifecycle.beforeProject { properties.forEach(project.ext::set) } } } +enableFeaturePreview("NO_IMPLICIT_LOOKUP_IN_PARENT_PROJECTS") + include 'cycle-detection-plugin' diff --git a/settings.gradle b/settings.gradle index 98073798c87..8ddcececcba 100644 --- a/settings.gradle +++ b/settings.gradle @@ -45,6 +45,7 @@ plugins { rootProject.name="spring-boot-build" enableFeaturePreview("STABLE_CONFIGURATION_CACHE") +enableFeaturePreview("NO_IMPLICIT_LOOKUP_IN_PARENT_PROJECTS") settings.gradle.projectsLoaded { develocity {