Grails 2.3.7 remove itext 2.0.8 jar

I am trying to upgrade an application from grails 2.2.4 to 2.3.7 and I have problems with iText dependencies.

running grails resource dependencies shows 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 by adding to BuildConfig

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

however, when I update the dependencies, Grails adds itext 2.0.8 anyway.

Can anyone give me a hint for a solution?

Regards

+4
source share
2 answers

itext 2.0.8 - dependency dependency: grails-docs. What you can do is to exclude grails-docs from 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 create

+--- 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
+8
source

itext, , . itext . itext .

 dependencies {
         build "com.lowagie:itext:2.1.0"
    }

. itext grails-docs.

+1

Source: https://habr.com/ru/post/1540545/


All Articles