相关文章推荐
帅气的钥匙扣  ·  Python on Azure | ...·  1 年前    · 
刚毅的斑马  ·  Spring boot ...·  3 年前    · 
酷酷的便当  ·  jacoco 排除 - OSCHINA - ...·  3 年前    · 
有胆有识的炒饭  ·  This relative module ...·  3 年前    · 
文雅的四季豆  ·  Gitee ...·  3 年前    · 

I’m really frustrated being unable to exclude Android httpclient. Even though the dependency graph states that:

+--- com.google.api-client:google-api-client-android:1.20.0
|    +--- com.google.api-client:google-api-client:1.20.0
|    |    +--- com.google.oauth-client:google-oauth-client:1.20.0
|    |    |    +--- com.google.http-client:google-http-client:1.20.0
|    |    |    |    +--- com.google.code.findbugs:jsr305:1.3.9
|    |    |    |    \--- org.apache.httpcomponents:httpclient:4.0.1
|    |    |    |         +--- org.apache.httpcomponents:httpcore:4.0.1
|    |    |    |         +--- commons-logging:commons-logging:1.1.1
|    |    |    |         \--- commons-codec:commons-codec:1.3
|    |    |    \--- com.google.code.findbugs:jsr305:1.3.9
|    |    +--- com.google.http-client:google-http-client-jackson2:1.20.0
|    |    |    +--- com.google.http-client:google-http-client:1.20.0 (*)
|    |    |    \--- com.fasterxml.jackson.core:jackson-core:2.1.3
|    |    \--- com.google.guava:guava-jdk5:13.0
|    \--- com.google.http-client:google-http-client-android:1.20.0
|         \--- com.google.http-client:google-http-client:1.20.0 (*)

It’s still there despite my attempt to exclude it from everywhere:

compile('com.google.api-client:google-api-client-android:1.20.0') {
    exclude group: 'org.apache.httpcomponents'
compile('com.google.http-client:google-http-client-gson:1.20.0') {
    exclude group: 'org.apache.httpcomponents'
compile('com.google.android.gms:play-services-identity:10.0.1') {
    exclude group: 'org.apache.httpcomponents'
compile('com.google.apis:google-api-services-drive:v2-rev176-1.20.0') {
    exclude group: 'org.apache.httpcomponents'

This is really frustrating. I could employ this:

configurations {
    compile.exclude group: 'org.apache.httpcomponents', module: "httpclient"

but I feel I would just use it out of desperation, since I would really like to be able to pinpoint where the dependency is coming from, and exclude it there.