Исключить транзитивную зависимость в Gradle

Во время сборки через Gradle я получил это

POM relocation to an other version number is not fully supported in Gradle : xml-apis:xml-apis:2.0.2 relocated to xml-apis:x
ml-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.

Батик 1.7 был использован в проекте. Эта версия Batik использует Xalan 2.6.0, который зависит от xml-apis 2.0.2, который был перемещен.

Как решить эту переходную зависимость?

1 ответ

Опция 1:

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

Смотрите ResolutionStrategy.force(...)

Вариант 2:

dependencies {
    compile "batik:batik:$batikVersion", {
       exclude group: "xml-apis", module: "xml-apis"
    }
    compile "xml-apis:xml-apis:1.0.b2"
}

Смотрите ModuleDependency.exclude(Карта)

Другие вопросы по тегам