Skip to content

Avoid Gradle deprecation warnings - #19727

Open
noojung wants to merge 1 commit into
spring-projects:mainfrom
noojung:avoid-gradle-deprecations
Open

noojung wants to merge 1 commit into
spring-projects:mainfrom
noojung:avoid-gradle-deprecations

Conversation

@noojung

@noojung noojung commented Sep 15, 2026

Copy link
Copy Markdown

Running the build and config module tests with --warning-mode=all reports the following deprecation warnings:

> Configure project :spring-security-bom
Using a Project object as a dependency constraint notation has been deprecated. This will fail with an error in Gradle 10. Please use the project(String) method on DependencyHandler or the createProjectDependency(String) method on DependencyFactory instead. Consult the upgrading guide for further information: https://docs.gradle.org/9.7.1/userguide/upgrading_version_9.html#dependency_project_notation

> Configure project :spring-security-docs
Using a Project object as a dependency notation has been deprecated. This will fail with an error in Gradle 10. Please use the project(String) method on DependencyHandler or the createProjectDependency(String) method on DependencyFactory instead. Consult the upgrading guide for further information: https://docs.gradle.org/9.7.1/userguide/upgrading_version_9.html#dependency_project_notation

> Configure project :spring-security-config
The AbstractTestTask.onOutput(Closure) method has been deprecated. This is scheduled to be removed in Gradle 10. Please use the addTestOutputListener(TestOutputListener) method instead. Consult the upgrading guide for further information: https://docs.gradle.org/9.7.1/userguide/upgrading_version_9.html#deprecated_test_methods

> Task :spring-security-config:test
Invocation of Task.project at execution time has been deprecated. This will fail with an error in Gradle 10. This API is incompatible with the configuration cache, which will become the only mode supported by Gradle in a future release. Consult the upgrading guide for further information: https://docs.gradle.org/9.7.1/userguide/upgrading_version_7.html#task_project

These usages will become errors in Gradle 10.

This PR updates the following:

  • spring-security-bom.gradle and DocsPlugin use DependencyFactory.createProjectDependency(...) instead of passing Project instances as dependency and dependency constraint notation.
  • spring-security-config.gradle replaces the deprecated AbstractTestTask.onOutput(Closure) method with addTestOutputListener.
  • spring-security-config.gradle also replaces project.hasProperty('serialization') with providers.gradleProperty('serialization').isPresent() in the listener, avoiding execution-time access to Task.project.

References:

Passing Project instances as dependency notation, accessing Task.project
at execution time, and calling AbstractTestTask.onOutput(Closure) are
deprecated and will become errors in Gradle 10.

Use DependencyHandler.project for BOM constraints and
DependencyFactory.createProjectDependency for Dokka dependencies.

Replace AbstractTestTask.onOutput(Closure) with addTestOutputListener
in the config module. Use ProviderFactory.gradleProperty to check
whether the serialization property is present without accessing
Task.project at execution time.

Signed-off-by: Hyunwoo Jung <hyunwoojung@kakao.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants