Java9模块错误:无法确定模块名称,未命名的模块读取包,模块org.reactivestreams从两者读取包



我得到了3个不同的错误。

  1. 无法确定模块名称
  2. 未命名的模块读取包
  3. 模块org.reactivestreams从两者读取包

这些错误究竟是什么?

build.gradle

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-webflux'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
exclude group: 'org.mockito', module: 'mockito-core'
}

testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-webtestclient'

compile("io.github.resilience4j:resilience4j-spring-boot2:1.3.1") {
exclude group: 'org.mockito', module: 'mockito-core'
}
compile("io.github.resilience4j:resilience4j-reactor:1.3.1") {
exclude group: 'org.mockito', module: 'mockito-core'
}
compile('org.springframework.boot:spring-boot-starter-aop')
compile('org.springframework.boot:spring-boot-starter-actuator')
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
}

错误消息:

任务:compileJava

错误:无法确定/Users/srihariprasad/.gradle/cachess/modules-2/files-2.1/io.github.resilience4j-framework-common/1.3.1/8c16dda86fad3c9251930cad21ac87aa34cd8035/resilience4j-framework-common-1.3.1.jar 的模块名称

错误:未命名的模块从reslient4j.spring.boot.common和io.github.resilience4j.springboot2 读取包io.githsub.resiliense4j.timelimiter.autoconfigure

错误:未命名的模块从resilience4j.spring.boot.common和io.github.resilience4j.springboot2 读取包io.github

错误:未命名的模块从reslient4j.spring.boot.common和io.github.resilience4j.springboot2读取包io.githsub.resiliense4j.ratimiter.autoconfigure错误:未命名的模块从reslient4j.spring.boot.common和io.github.resilience4j.springboot2读取包io.githsub.resilience 4j.circuitbreaker.autoconfigure错误:未命名的模块读取包io.github.resilience4j.bulkhead.au以从reslient4j.spring.boot.common和io.github.resilience 4j.springboot2 进行配置

错误:模块org.reactivestreams从reslient4j.spring.boot.common和io.github.resilience4j.springboot2 读取包io.githsub.resiliense4j.timelimiter.autoconfigure

我们如何从哪个jar中找到这两个模块,以排除它们。1.弹性4j.spring.boot.common,2。io.github.resilience4j.springboot2。根据我的理解,我需要将罐子排除在弹性4j-spring-bot2:1.3.1之外。但我不明白该怎么做?

未命名模块导出的包只能由另一个未命名模块读取。命名模块不可能读取(需要(未命名模块。http://tutorials.jenkov.com/java/modules.html#unnamed-模块

您正在使用Resilience4j作为自动模块,但关于不允许拆分包的规则也适用于自动模块。如果多个JAR文件包含(并因此导出(同一个Java包,那么这些JAR文件中只有一个可以用作自动模块。我们必须在Resilience4j中解决这个拆分包的问题。在此之前,您可以在运行应用程序时对Java VM使用-classpath参数。在类路径中,您可以包括所有旧的Java类,就像您在Java 9之前所做的那样。类路径上找到的所有类都将包含在Java所称的未命名模块中。

最新更新