Grails - attempting to include HTPPBuilder - Linka

2019-09-06 12:47发布

问题:

When I run grails install-dependency, I get this.

java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for
    a different type with name "org/xml/sax/SAXParseException"

What's wrong? I've not used grails dependency management before, and this is rather cryptic.

repositories {        
    grailsPlugins()
    grailsHome()
    mavenLocal()
    mavenCentral()
}

dependencies {
     runtime 'org.codehaus.groovy.modules.http-builder:http-builder:0.5.0'
}

回答1:

Looks like an xml-apis clash,

Try

dependencies {
     runtime 'org.codehaus.groovy.modules.http-builder:http-builder:0.5.0'{
         excludes 'xml-apis'
     }
}