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.
Environment
spotlessCheckandspotlessApplyReproduction
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:
Actual behavior
Gradle reports:
The relevant stack trace is:
In Spotless 8.10.2,
GradleProvisioner.forConfigurationContainerconfigures the detached configuration with: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.