Consider shading the JGit dependency in Grade plugin
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- java
- 领域
- build-system
调研方向
首先使用 Spotless 4.0.1、GitPublish 以及所示的 Scala scalafmt 配置复现冲突,然后检查 Gradle 插件的 JGit 依赖设置。将结果与 Gradle 关于最小化外部插件依赖的指导进行比较。当 GitPublish 和 Spotless 能够共存,且不再出现报告的由不兼容 JGit 版本导致的通用类链接错误时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Summary
In Gradle, all plugins share the same classpath. This makes it very hard, if not impossible, to use plugins which depend on different incompatible versions of the same library. This is the case with Spotless and GitPublish:
- Spotless depends on 5.7.0.202003110725-r
- GitPublish depends on the "latest release" version, which for the latest version of the plugin itself is 5.6.0.201912101111-r
Downgrading the JGit dependency in Spotless, I believe, is not an option, but maybe you could consider shading this dependency, building it into the Gradle plugin JAR file? I believe that the official Gradle guidelines recommend minimizing the number of external dependencies, and shading is one of the ways to mitigate issues like this one.
Gradle version
Happens with any Gradle version, including the latest one, 6.4.1
Spotless version
4.0.1
Operating system and version
Probably not relevant, but macOS 10.15.3
Spotless configuration
Having something as simple as
spotless {
scala {
scalafmt("2.3.2").configFile(layout.projectDirectory.file(".scalafmt.conf"))
}
}
in the build configuration will reproduce the issue,.
Console errors
In all my test cases any Spotless tasks don't cause errors; exceptions can be observed when the GitPublish plugin is used, and they are generic class linkage errors which happen when binary incompatible libraries with the same class names are present in the one classpath.
- 主要语言
- Java
- 星标
- 5.7k
- 派生
- 563
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 51
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
diffplug/spotless 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
diffplug/spotless#3125 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 78/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
查看 diffplug/spotless 的全部 Issue
相似的 Issue
-
0 - Backlog 1 - Ready documentation good first issue help wanted
难度 2/5 1-3 小时 新手友好度 78/100
-
cbor
难度 2/5 1-3 小时 新手友好度 84/100
FasterXML/jackson-dataformats-binary#844 ·
维护者通常 1 天内回复
-
improvement
难度 2/5 1-3 小时 新手友好度 78/100
apache/iceberg#18351 · 1 条评论 ·
维护者通常 1 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 90/100
repowise-dev/repowise#2945 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复