【问题标题】:Exclude Dependency Gradle排除依赖 Gradle
【发布时间】:2017-09-21 03:11:59
【问题描述】:

我遇到了依赖冲突的问题。

这两个罐子是:

  • net.sf.jasperreports:jasperreports:6.4.1
  • com.connectifier.xero:client:0.13

两者似乎都在加载相同依赖项的不同版本: org.bouncycastle.

无论我尝试什么,我似乎都无法让它工作。

一直在尝试这样的事情:

configure(globalModule) {

dependencies {
    compile('net.sf.jasperreports:jasperreports:6.4.1')
    compile('com.lowagie:itext:2.1.7') {
       exclude group: 'org.bouncycastle'
    }
    compile('com.connectifier.xero:client:0.13') {
       exclude group: 'org.bouncycastle'
    }
}

我不断收到的错误是:

SecurityException: class "org.bouncycastle.asn1.pkcs.RSAPublicKey" 的签名者信息与同一包中其他类的签名者信息不匹配

如果我不导入 JasperReports,应用程序将运行良好,但我绝对需要这个。

【问题讨论】:

    标签: java gradle dependencies


    【解决方案1】:

    我已经解决了! gradle 中的常规排除方法不起作用,解决方法如下:

    configure(globalModule) {
        dependencies {
            compile('net.sf.jasperreports:jasperreports:6.4.1')
            compile('com.connectifier.xero:client:0.13')    
            compile('com.lowagie:itext:2.1.7')    
        }   
    
        configurations {
            compile {
                exclude group: 'org.bouncycastle'
                exclude module: 'bcprov-jdk14'
            }
        }
        task enhance(type: CubaEnhancing)   
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-08
      • 1970-01-01
      • 1970-01-01
      • 2021-12-05
      • 2020-07-27
      • 1970-01-01
      • 1970-01-01
      • 2016-11-19
      相关资源
      最近更新 更多