codeconsole opened a new pull request, #16075:
URL: https://github.com/apache/grails-core/pull/16075
### Problem
Applying the Grails Gradle plugins under Gradle 9.x emits deprecation
warnings for three APIs scheduled for removal in Gradle 10, so every consuming
build prints *"Deprecated Gradle features were used in this build, making it
incompatible with Gradle 10."* even when the app's own build scripts are fully
migrated.
Observed from a Grails 8.0.0-M4 app on Gradle 9.6.1 with `--warning-mode all
-Dorg.gradle.deprecation.trace=true`; the traces point at:
- `The Project.getProperties method has been deprecated.` —
`project.properties['…']` lookups in `GrailsGradlePlugin`
(`excludeDependencies`, `configureProfile`, `createBuildPropertiesTask`,
`configureGroovy`)
- `The Project.container(Class, Closure) method has been deprecated.` —
`TestPhasesGradlePlugin.apply`
- `The DomainObjectCollection.findAll(Closure) method has been deprecated.`
— `GrailsGradlePlugin.configureMicronaut`
### Fix
Like-for-like replacements with the documented substitutes:
- `project.properties['name']` → `project.findProperty('name')` — same
resolution chain (project object property → extra properties → gradle
properties), no behavior change.
- `project.container(TestPhase) { … }` →
`project.objects.domainObjectContainer(TestPhase) { … }` — the replacement
named by the deprecation message. The class is `@CompileStatic`, so the closure
statically coerces to `NamedDomainObjectFactory<TestPhase>`.
- `getAllDependencies().findAll { … } as boolean` →
`getAllDependencies().any { … }` — the call was only an existence check, and
`any` is a plain Groovy `Iterable` method rather than the deprecated
live-collection API.
Verified with `:grails-gradle-plugins:compileGroovy` and the module test
suite.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]