我发现了一些与我的问题类似的东西,但它与maven而不是gradle有关:java 9 unnamed module reads package [X] from both ... while debugging (with IntelliJ)
最后,我决定在我现有的项目上开始使用java中的新的ish模块系统。我创建了一个模块-info.java,它包含:
requires com.sothawo.mapjfx;
requires MaterialFX;
requires thymeleaf;
requires org.apache.httpcomponents.httpclient;
requires com.fasterxml.jackson.databind;
requires org.apache.httpcomponents.httpcore;
requires bugsnag;
requires org.jfxtras.styles.jmetro;
requires org.slf4j;
requires javafx.swing;
requires itext;
requires flying.saucer.pdf;我的build.gradle:
dependencies {
implementation ('io.github.palexdev:materialfx:11.13.0') {
exclude group: 'org.openjfx'
}
implementation ('org.jfxtras:jmetro:11.6.15') {
exclude group: 'org.openjfx'
}
implementation 'org.thymeleaf:thymeleaf:3.1.0.M1'
implementation 'org.xhtmlrenderer:flying-saucer-pdf:9.1.22'
implementation 'com.fasterxml.jackson.core:jackson-core:2.13.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.1'
implementation 'org.apache.httpcomponents:httpclient:4.5.13'
implementation 'org.slf4j:slf4j-api:1.7.36'
implementation 'org.slf4j:slf4j-simple:1.7.36'
implementation 'com.bugsnag:bugsnag:3.6.3'
implementation 'com.sothawo:mapjfx:3.1.0'
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
}每次我试图构建这样的错误时,我都会遇到这样的错误:
module ChanceTracker.main reads package org.bouncycastle.tsp.cms from both bctsp.jdk14 and org.bouncycastle.pkix
error: the unnamed module reads package org.xhtmlrenderer.simple from both flying.saucer.pdf and flying.saucer.core(和一群似乎关系密切的其他人一起)
运行的依赖关系显示了这一点(这里只显示了相关的部分):
+--- org.xhtmlrenderer:flying-saucer-pdf:9.1.22
| +--- com.lowagie:itext:2.1.7
| +--- org.bouncycastle:bcmail-jdk14:1.64
| | +--- org.bouncycastle:bcprov-jdk14:1.64
| | \--- org.bouncycastle:bcpkix-jdk14:1.64
| | \--- org.bouncycastle:bcprov-jdk14:1.64
| +--- org.bouncycastle:bctsp-jdk14:1.46
| | +--- org.bouncycastle:bcprov-jdk14:1.46 -> 1.64
| | \--- org.bouncycastle:bcmail-jdk14:1.46 -> 1.64 (*)
| +--- org.bouncycastle:bcprov-jdk14:1.64
| \--- org.xhtmlrenderer:flying-saucer-core:9.1.22我很少尝试使用gradle,但是我尝试了在我的依赖项中使用不同的“排除”,而没有运气。
发布于 2022-03-02 04:52:24
固定在
implementation ('org.xhtmlrenderer:flying-saucer-pdf:9.1.22') {
exclude group: 'org.bouncycastle'
exclude group: 'org.xhtmlrenderer'
}https://stackoverflow.com/questions/71316990
复制相似问题