[Gradle] Configuration.setVisible(boolean) deprecation warning on Gradle 9.8
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 85/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java
- 领域
- build-system
调研方向
从 GradleProvisioner.java 开始,重点检查第 136 行附近的 forConfigurationContainer,并检查 JarState.provisionWithTransitives 使用的 detached configuration 设置。使用 warning-mode all,通过 spotlessCheck 和 spotlessApply 运行提供的 Gradle 9.8 复现。完成的标准是 formatter provisioning 仍然成功,且不再出现 Configuration.setVisible(boolean) 的弃用警告。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Java
- 星标
- 5.7k
- 派生
- 563
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 52
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
diffplug/spotless 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 52/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
diffplug/spotless#3067 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 66/100
diffplug/spotless#3040 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 52/100
维护者通常 1 天内回复
查看 diffplug/spotless 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
github/copilot-sdk#2793 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
enhancement good first issue
难度 1/5 1-3 小时 新手友好度 88/100