如何在gradle依赖项的依赖项中指定分类器? [英] How to specify a classifier in a gradle dependency's dependency?
本文介绍了如何在gradle依赖项的依赖项中指定分类器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道我可以做到以下几点,但是我可以在不排除guice模块的情况下一步完成它吗?
依赖关系{
编译(组:'com.google.inject.extensions',名称:'guice-assistedinject ',版本:'3.0'){
排除模块:'guice'
}
编译组:'com.google.inject',名称:'guice',版本:'3.0' ,classifier:'no_aop'
}
解决方案
没有更简单的解决方案。您可以使用短依赖性表示法缩短代码(例如com.google.inject:guice:3.0:no_aop
)。
Say I want to add guice-assistedinject as a dependency in my project. It specifies the guice artifact as a dependency itself. How do I tell it to use the no_aop version of guice?
I know I can do the following, but can I do it in one step without excluding the guice module?
dependencies {
compile (group: 'com.google.inject.extensions', name: 'guice-assistedinject', version: '3.0') {
exclude module: 'guice'
}
compile group: 'com.google.inject', name: 'guice', version: '3.0', classifier: 'no_aop'
}
解决方案
There is no simpler solution. You can shorten the code by using short dependency notation (e.g. "com.google.inject:guice:3.0:no_aop"
).
这篇关于如何在gradle依赖项的依赖项中指定分类器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文