Grails 2.3.7 remove itext 2.0.8 jar

grails

Solution

itext 2.0.8 is a dependency of a dependency: grails-docs. What you can do is exclude grails-docs from the inherited global dependencies and then specifically add it excluding itext.

grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        excludes "grails-docs"
    }

    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
        // runtime 'mysql:mysql-connector-java:5.1.24'
        build('org.grails:grails-docs:2.3.7') {
            excludes 'itext'
        }
    }
}

This will produce

+--- org.grails:grails-docs:2.3.7
|    \--- org.xhtmlrenderer:core-renderer:R8
|    \--- org.yaml:snakeyaml:1.8
|    \--- org.grails:grails-gdoc-engine:1.0.1
|    \--- commons-lang:commons-lang:2.6

Problem

I trying to update an application from grails 2.2.4 to 2.3.7 and i have issues with iText dependencies. executing grails resources-dependencies show me that i have 2 jars for iText ``` +--- org.grails:grails-docs:2.3.7 | \--- org.xhtmlrenderer:core-renderer:R8 | \--- org.yaml:snakeyaml:1.8 | \--- org.grails:grails-gdoc-engine:1.0.1 | \--- **com.lowagie:itext:2.0.8** | \--- commons-lang:commons-lang:2.6 +--- org.grails.plugins:jasper:1.8.0 | \--- **com.lowagie:itext:2.1.7** | \--- bouncycastle:bcmail-jdk14:138 | \--- bouncycastle:bcprov-jdk14:138 | \--- org.bouncycastle:bctsp-jdk14:1.38 | \--- org.bouncycastle:bcprov-jdk14:1.38 | \--- org.bouncycastle:bcmail-jdk14:1.38 ``` I tried to remove itext 2.0.8 adding on BuildConfig ``` grails.project.dependency.resolution = { // inherit Grails' default dependencies inherits("global") { excludes "itext" } ``` however when i refresh dependencies Grails add itext 2.0.8 anyway. Someone could give me an hint for a solution? Best Regard

Original source