[Gradle] Configuration.setVisible(boolean) deprecation warning on Gradle 9.8
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:
spotlessCheckandspotlessApply
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from diffplug/spotless
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
diffplug/spotless#3067 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
diffplug/spotless#3040 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
diffplug/spotless#3013 · 2 comments ·
Maintainers usually reply within 1 day
All issues in diffplug/spotless
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openhab/openhab-core#5847 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
apache/parquet-java#3820 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
beehive-lab/jllm#187 ·