有没有一种方法可以排除特定版本的传递依赖项?我目前有以下内容,但似乎不支持该版本。
configurations {
compile.exclude group: 'org.hibernate',module: 'hibernate-core'
}
Run Code Online (Sandbox Code Playgroud)
也许不是这样的答案,但可能会有所帮助。
Gradle会忽略exclude子句中的版本(仅支持module和group),而实现目标的一种方法是从另一个角度进行攻击。如果您有兴趣排除特定版本,也许可以选择强制使用另一个版本,这可以通过以下方法实现:
configurations.all {
resolutionStrategy {
force 'your-lib:your-ver'
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2531 次 |
| 最近记录: |