UNRESOLVED DEPENDENCIES for commons-codec
Asked Answered
L

3

5

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.

Lumbering answered 3/11, 2013 at 9:45 Comment(0)
L
3

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"
        }
}
Lumbering answered 3/11, 2013 at 9:53 Comment(1)
I edited my answer, the previous solution raised a new problem :)Lumbering
A
5

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.

Ammoniac answered 14/1, 2014 at 15:25 Comment(1)
Solved my problem, thanks! In case of any problem - clear the caches first. This is Grails...Sanfordsanfourd
L
3

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"
        }
}
Lumbering answered 3/11, 2013 at 9:53 Comment(1)
I edited my answer, the previous solution raised a new problem :)Lumbering
I
0

Removing .ivy2/cache/ helped me resolving the dependencies.

Infernal answered 4/12, 2017 at 6:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.