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
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
There is no need to exclude the itext version,instead explicitly add the version in dependency as below. This would override any plugins itext with the below version. In future ,adding a new plugin with itext also won't cause any issue.
dependencies {
build "com.lowagie:itext:2.1.0"
}
Note: Don't exclude any itext or grails-docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With