Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UNRESOLVED DEPENDENCIES for commons-codec

I'm trying to retrieve the library for Google Reporting API:

compile 'com.google.apis:google-api-services-analytics:v3-rev74-1.17.0-rc'

but I got an unresolved dependencies error and I don't know what to do with it:

:: commons-codec#commons-codec;1.6: configuration not found in commons-codec#commons-codec;1.6: 'master'. It was required from org.apache.httpcomponents#httpclient;4.0.1 compile

I checked the .grails\ivy-cache\ folder and there's a commons-codec folder with jars of commons-codec-1.5, few xml files ivy-1.5.xml and ivy-1.6.xml and ivydata-1.5.properties and ivydata-1.6.properties. I also tried to delete the whole ivy-cache folder, but the result is the same.

like image 546
Lojza Ibg Avatar asked Nov 03 '13 09:11

Lojza Ibg


2 Answers

In my grails project i solved it by deleting the folder "commons-codec" from the ivy-cache. The dependency was new loaded then and the error was solved.

like image 158
David Hermanns Avatar answered Nov 15 '22 04:11

David Hermanns


Just right after writing my question, I found an answer. Changing the "compile" scope to "build" should resolve the error:

build 'com.google.apis:google-api-services-analytics:v3-rev74-1.17.0-rc'

Actually this solved my previous problem, but raised another one :) A "build" scope includes the library only when compiling, but not at runtime! So I didn't have google-api-services-analytics available when deployed to Tomcat. My final and working solution is:

dependencies {
        def googleLibVersion = "1.17.0-rc"
        compile("com.google.apis:google-api-services-analytics:v3-rev74-${googleLibVersion}") {
            excludes "commons-codec"
        }
        compile("com.google.http-client:google-http-client-jackson2:${googleLibVersion}") {
            excludes "commons-codec"
        }
}
like image 23
Lojza Ibg Avatar answered Nov 15 '22 04:11

Lojza Ibg