Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle download dependency error

I'm trying to add the following dependency:

compile group: 'com.cedarsoft.commons', name:'test-utils', version:'5.0.9'

Gradle downloads a couple of jars and then I'm getting the following error:

POM relocation to an other version number is not fully supported in Gradle : xml-apis#xml-apis;2.0.2   relocated to xml-apis#xml-apis;1.0.b2.
Please update your dependency to directly use the correct version 'xml-apis#xml-apis;1.0.b2'.
Resolution will only pick dependencies of the relocated element.  Artifacts and other metadata will    be ignored.

Any ideas why and how to solve this issue?

like image 700
Urbanleg Avatar asked Mar 24 '14 15:03

Urbanleg


People also ask

How do I clear all Gradle dependencies?

Generally, you can refresh dependencies in your cache with the command line option --refresh-dependencies. You can also delete the cached files under ~/. gradle/caches . With the next build Gradle would attempt to download them again.

Where does Gradle download its dependencies?

Gradle declares dependencies on JAR files inside your project's module_name /libs/ directory (because Gradle reads paths relative to the build.gradle file). This declares a dependency on version 12.3 of the "app-magic" library, inside the "com.example.android" namespace group.


1 Answers

configurations.all {
    resolutionStrategy {
        force 'xml-apis:xml-apis:1.4.01'
    }
}

Or use 1.0.b2. The issue is that there POM of xml-apis redirects for 2.0.2 (as khmarbaise wrote) to the same group and artefact, only version being 1.0.b2, which somehow fools Gradle (or underlying Ivy) resolution mechanism.

The credit goes to Mark Petrovic Gradle Forum

like image 184
Piohen Avatar answered Oct 08 '22 00:10

Piohen