mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
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 <hyunwoojung@kakao.com> See gh-51625
32 lines
1005 B
Groovy
32 lines
1005 B
Groovy
/*
|
|
* Copyright 2012-present the original author or authors.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
|
|
pluginManagement {
|
|
new File(rootDir.parentFile.parentFile, "gradle.properties").withInputStream {
|
|
def properties = new Properties()
|
|
properties.load(it)
|
|
properties.forEach(settings.ext::set)
|
|
gradle.lifecycle.beforeProject {
|
|
properties.forEach(project.ext::set)
|
|
}
|
|
}
|
|
}
|
|
|
|
enableFeaturePreview("NO_IMPLICIT_LOOKUP_IN_PARENT_PROJECTS")
|
|
|
|
include 'cycle-detection-plugin'
|