Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Geschlossen Anfängerfreundlich
#3,099 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
85/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
java
Bereich
build-system

Rechercherichtung

Beginne in GradleProvisioner.java, insbesondere bei forConfigurationContainer um Zeile 136, und untersuche die Einrichtung der detached configuration, die von JarState.provisionWithTransitives verwendet wird. Führe die bereitgestellte Gradle-9.8-Reproduktion mit spotlessCheck und spotlessApply unter Verwendung von warning-mode all aus. Erledigt ist die Aufgabe, wenn die Bereitstellung des Formatters weiterhin erfolgreich ist, ohne dass die Deprecation-Warnung für Configuration.setVisible(boolean) ausgegeben wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Java
Sterne
5.7k
Forks
563
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
52

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus diffplug/spotless

Alle Issues in diffplug/spotless

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.