Gradle依赖项排除后仍对classpath依赖 [英] Dependency still on classpath after Gradle dependency exclusion

查看:138
本文介绍了Gradle依赖项排除后仍对classpath依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要删除:

"com.vaadin.external.google:androidjson:0.0.20131108.vaadin1"

"com.vaadin.external.google:androidjson:0.0.20131108.vaadin1"

来自我的类​​路径.在依赖关系树中,我看到了这种依赖关系来自:

from my classpath. With the dependency tree I saw that this dependency comes from:

'org.springframework.boot:spring-boot-configuration-rocessor:1.5.8.RELEASE'.

'org.springframework.boot:spring-boot-configuration-rocessor:1.5.8.RELEASE'.

因此我将其更改为以下内容:

Therefore I changed it to the following:

compile ('org.springframework.boot:spring-boot-configuration-processor:1.5.8.RELEASE'){
    exclude group: 'com.vaadin.external.google', module: 'android-json'
}

我的问题是依存关系仍然被取消:

My issue is that the dependency still gets pulled:

...
+--- org.springframework.boot:spring-boot-configuration-processor:1.5.8.RELEASE
|    \--- com.vaadin.external.google:android-json:0.0.20131108.vaadin1
...

我在做什么错了?

推荐答案

您可能还具有测试依赖项,因此需要将其排除在外.在脚本中包含以下内容:

It's likely you have a test dependency as well that needs to be excluded. Include the following in your script:

testCompile("org.springframework.boot:spring-boot-starter-te‌​st") { 
    exclude group: 'com.vaadin.external.google', module: 'android-json
'}

这篇关于Gradle依赖项排除后仍对classpath依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆