Grails将bouncycaSTLe:bcprov-jdk14:138作为全局依赖项

+--- org.grails:grails-docs:2.3.3
|    \--- org.xhtmlrenderer:core-renderer:R8
|    \--- org.yaml:snakeyaml:1.8
|    \--- org.grails:grails-gdoc-engine:1.0.1
|    \--- com.lowagie:itext:2.0.8
|         \--- bouncycastle:bcmail-jdk14:138
|         \--- bouncycastle:bcprov-jdk14:138
|    \--- commons-lang:commons-lang:2.6

但是我的应用程序需要bcprov-jdk15on-149。当我将其添加为依赖项时,它不会退出旧版本
dependencies {
    build 'org.bouncycastle:bcpg-jdk15on:1.49'
    build 'org.bouncycastle:bcprov-jdk15on:1.49'
}

我尝试了很多变体来排除它,但没有人起作用
inherits("global") {
    //excludes 'grails-docs'

    excludes 'org.bouncycastle:bcmail-jdk14:138'
    excludes 'bouncycastle:bcmail-jdk14:138'
    excludes 'bcmail-jdk14-138.jar'
    excludes 'bcmail-jdk14'
    excludes 'bcmail'

    excludes 'bouncycastle:bcprov-jdk14:jar:138'
    excludes 'org.bouncycastle:bcprov-jdk14:138'
    excludes 'bouncycastle:bcprov-jdk14:138'
    excludes 'bcprov-jdk14-138.jar'
    excludes 'bcprov-jdk14'
    excludes 'bcprov'
    excludes 'bouncycastle'
}

使它起作用的唯一方法–排除整个“grail-docs”依赖项。

如何仅排除旧的bcprov-jdk14:138?

还是新的(bcprov-jdk15on-149)驱逐旧的(bcprov-jdk14:138)怎么办?

最佳答案

似乎是一个已报告的错误>> http://jira.grails.org/browse/GRAILS-10640

我通过覆盖com.logwagie.itext依赖项找到了解决方法。

dependencies {
    // add this line
    build("com.lowagie:itext:2.1.7") { excludes "bouncycastle:bcprov-jdk14:138", "org.bouncycastle:bcprov-jdk14:1.38" }
}

希望这会帮助你。

07-27 14:57