类 "org.bouncycastle.asn1.ASN1Primitive" 的签名者信息与同一包中其他类的签名者信息不匹配



我正在尝试调用以下行。。。

PdfCopy copy = null;
...
copy.setEncryption(password.getBytes(), null, PdfWriter.ALLOW_PRINTING | PdfWriter.ALLOW_COPY, PdfWriter.ENCRYPTION_AES_128)

我得到

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

这似乎与Grails和以前版本的弹性城堡有关,所以我尝试在我的pom中添加以下内容。。。

    <dependency>
        <groupId>org.grails.plugins</groupId>
        <artifactId>rendering</artifactId>
        <version>0.4.4</version>
        <scope>compile</scope>
        <type>zip</type>
        <exclusions>
            <exclusion>
                <groupId>bouncycastle</groupId>
                <artifactId>bcmail-jdk14</artifactId>
            </exclusion>
            <exclusion>
                <groupId>bouncycastle</groupId>
                <artifactId>bcprov-jdk14</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <!-- Needed for rendering plugin -->
    <dependency>
        <groupId>org.xhtmlrenderer</groupId>
        <artifactId>core-renderer</artifactId>
        <version>R8</version>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <groupId>bouncycastle</groupId>
                <artifactId>bcmail-jdk14</artifactId>
            </exclusion>
            <exclusion>
                <groupId>bouncycastle</groupId>
                <artifactId>bcprov-jdk14</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    ...
    <dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>itextpdf</artifactId>
        <version>5.3.2</version>
    </dependency>
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15on</artifactId>
        <version>1.47</version>
    </dependency>
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcmail-jdk15on</artifactId>
        <version>1.47</version>
    </dependency>
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bctsp-jdk15</artifactId>
        <version>1.46</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

但没有骰子。。。。我正在使用Grails 2.3.7有人有什么建议吗?

此外,当我运行mvn-dependency:tree-Dverbose时,我看不到任何其他引用。

问题与grails-doc插件有关。我通过运行grails dependency-report发现了这一点,它在grails-doc中显示了一个旧的iText依赖项。

在BuildConfig中排除此项效果良好。

基本上这。。。

如何排除grails全局依赖

最新更新