How to specify a classifier in a gradle dependency's dependency?

北慕城南 提交于 2019-12-18 11:00:09

问题


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'
}

回答1:


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").



来源:https://stackoverflow.com/questions/13188438/how-to-specify-a-classifier-in-a-gradle-dependencys-dependency

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!