排除特定版本的传递依赖项的所有实例-Gradle [英] Excluding all instances of a specific version of transitive dependency - Gradle
本文介绍了排除特定版本的传递依赖项的所有实例-Gradle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以排除特定版本的传递依赖项?我目前有以下版本,但似乎不支持该版本.
Is there a way to exclude specific version of a transitive dependency? I currently have the below but version doesn't seem to be supported.
configurations {
compile.exclude group: 'org.hibernate',module: 'hibernate-core'
}
推荐答案
也许不是这样的答案,但可能会有所帮助.
Gradle忽略排除子句中的版本(仅支持 module
和 group
),实现目标的一种方法是从另一个角度进行攻击.如果您有兴趣排除特定版本,也许可以选择强制使用其他版本,这可以通过以下方式实现:
Gradle ignores version in exclude clause (only supports module
and group
) and one way to achieve your goal is to attack it from a different angle. If you are interested in excluding particular version, maybe you could settle on forcing another version instead, that could be achieved with:
configurations.all {
resolutionStrategy {
force 'your-lib:your-ver'
}
}
这篇关于排除特定版本的传递依赖项的所有实例-Gradle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文