Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Gradle] Configuration.setVisible(boolean) deprecation warning on Gradle 9.8

Open Beginner friendly
#3,099 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
build-system

Research direction

Start in GradleProvisioner.java, especially forConfigurationContainer around line 136, and inspect the detached configuration setup used by JarState.provisionWithTransitives. Run the supplied Gradle 9.8 reproduction with spotlessCheck and spotlessApply using warning-mode all. Done means formatter provisioning still succeeds without the Configuration.setVisible(boolean) deprecation warning.

Written by the indexing model from the issue text.

Description

Environment
  • Spotless Gradle plugin: 8.10.2
  • Gradle: 9.8.0
  • Reproduced with: spotlessCheck and spotlessApply
Reproduction

A formatter that provisions external dependencies is enough to reproduce it, for example:

plugins {
    id("com.diffplug.spotless") version "8.10.2"
}

repositories {
    mavenCentral()
}

spotless {
    java {
        googleJavaFormat()
    }
}

Run:

./gradlew spotlessCheck --warning-mode all -Dorg.gradle.deprecation.trace=true
Actual behavior

Gradle reports:

The Configuration.setVisible(boolean) method has been deprecated.
This is scheduled to be removed in Gradle 11.

The relevant stack trace is:

at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.setVisible(DefaultConfiguration.java:376)
at org.gradle.api.internal.artifacts.configurations.DefaultLegacyConfiguration_Decorated.setVisible(Unknown Source)
at com.diffplug.gradle.spotless.GradleProvisioner.lambda$forConfigurationContainer$2(GradleProvisioner.java:136)
at com.diffplug.gradle.spotless.GradleProvisioner$DedupingProvisioner.provisionWithTransitives(GradleProvisioner.java:91)
at com.diffplug.spotless.JarState.provisionWithTransitives(JarState.java:132)

In Spotless 8.10.2, GradleProvisioner.forConfigurationContainer configures the detached configuration with:

config.setCanBeConsumed(false);
config.setVisible(false);

I see the warning from formatters that provision external dependencies, including Gherkin, Java (google-java-format), JSON (Gson), and Kotlin (ktlint). The build still succeeds, but Gradle generates a problems report containing the warnings.

Gradle upgrade guide: https://docs.gradle.org/9.8.0/userguide/upgrading_version_9.html#deprecate-visible-property

Expected behavior

Spotless should run on Gradle 9.8 without deprecation warnings and remain compatible when Configuration.setVisible(boolean) is removed in Gradle 11.

Dominant language
Java
Stars
5.7k
Forks
560
Avg merge
1d 6h
Merged PRs (30d)
48

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/spotless

All issues in diffplug/spotless

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.