Skip to content

Undeclared build service deprecation when enabling stable configuration cache #1260

@ciscoo

Description

@ciscoo

If you are submitting a bug, please include the following:

  • summary of problem
  • gradle or maven version
  • spotless version
  • operating system and version
  • copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
  • copy-paste the full content of any console errors emitted by gradlew spotless[Apply/Check] --stacktrace

If you're just submitting a feature request or question, no need for the above.


Gradle 7.5 adds a new feature preview flag for stable configuration cache. When enabled, warnings appear due to Spotless' undeclared usage of SpotlessTaskService:

https://docs.gradle.org/7.5/release-notes.html#new-stable_configuration_cache-feature-flag

> Task :spotlessKotlinGradleApply UP-TO-DATE
Build service 'SpotlessTaskService' is being used by task ':spotlessKotlinGradleApply' without the corresponding declaration via 'Task#usesService'. This will fail with an error in Gradle 8.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: https://docs.gradle.org/7.5/userguide/upgrading_version_7.html#undeclared_build_service_usage

> Task :cxf-codegen-gradle:spotlessJava
Build service 'SpotlessTaskService' is being used by task ':cxf-codegen-gradle:spotlessJava' without the corresponding declaration via 'Task#usesService'. This will fail with an error in Gradle 8.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: https://docs.gradle.org/7.5/userguide/upgrading_version_7.html#undeclared_build_service_usage

> Task :cxf-codegen-gradle:spotlessJavaApply
Build service 'SpotlessTaskService' is being used by task ':cxf-codegen-gradle:spotlessJavaApply' without the corresponding declaration via 'Task#usesService'. This will fail with an error in Gradle 8.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: https://docs.gradle.org/7.5/userguide/upgrading_version_7.html#undeclared_build_service_usage

> Task :cxf-codegen-gradle:spotlessKotlinGradleApply UP-TO-DATE
Build service 'SpotlessTaskService' is being used by task ':cxf-codegen-gradle:spotlessKotlinGradleApply' without the corresponding declaration via 'Task#usesService'. This will fail with an error in Gradle 8.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: https://docs.gradle.org/7.5/userguide/upgrading_version_7.html#undeclared_build_service_usage

> Task :documentation:spotlessJavaApply UP-TO-DATE
Build service 'SpotlessTaskService' is being used by task ':documentation:spotlessJavaApply' without the corresponding declaration via 'Task#usesService'. This will fail with an error in Gradle 8.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: https://docs.gradle.org/7.5/userguide/upgrading_version_7.html#undeclared_build_service_usage

> Task :documentation:spotlessKotlinGradleApply UP-TO-DATE
Build service 'SpotlessTaskService' is being used by task ':documentation:spotlessKotlinGradleApply' without the corresponding declaration via 'Task#usesService'. This will fail with an error in Gradle 8.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: https://docs.gradle.org/7.5/userguide/upgrading_version_7.html#undeclared_build_service_usage
  • Gradle 7.5
  • Java 11 Temurin
  • Spotless 6.8.0
  • Linux Mint 20.3

You can see the warnings with a plugin I maintain. Specific Spotless configuration here: https://github.com/ciscoo/cxf-codegen-gradle/blob/master/buildSrc/src/main/kotlin/code-style-conventions.gradle.kts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions