Java9模块错误:无法确定模块名称,未命名模块读取包,模块org.reactivestreams同时从这两个模块读取包

Java9模块错误:无法确定模块名称,未命名模块读取包,模块org.reactivestreams同时从这两个模块读取包,java,spring-boot,java-9,java-11,resilience4j,Java,Spring Boot,Java 9,Java 11,Resilience4j,我得到3个不同的错误 无法确定模块名称 未命名的模块读取包 模块org.reactivestreams从两个位置读取包 这些错误到底是什么 格雷德尔先生 dependencies { implementation 'org.springframework.boot:spring-boot-starter-webflux' testImplementation('org.springframework.boot:spring-boot-starter-test') { e

我得到3个不同的错误

  • 无法确定模块名称
  • 未命名的模块读取包
  • 模块org.reactivestreams从两个位置读取包
  • 这些错误到底是什么

    格雷德尔先生

    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'
    }
    
    错误消息:

    任务:编译ejava

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

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

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

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

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


    我们怎样才能找到这两个模块,从哪个jar中排除它们呢。1.resilience4j.spring.boot.common,2。io.github.resilience4j.springboot2。根据我的理解,我需要从resilience4j-spring-boot2:1.3.1中排除JAR。但是我不明白怎么做?

    未命名模块导出的包只能由另一个未命名模块读取。命名模块不可能读取(需要)未命名模块。

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

    这是否回答了您的问题-?如果我从gradle中删除这两个依赖项,它工作正常,但我需要这些编译(“io.github.resilience4j:resilience4j-spring-boot2:1.3.1”){exclude group:'org.mockito',module:'mockito core'}编译(“io.github.resilience4j:resilience4j reactor:1.3.1”){exclude group:'org.mockito',module:'mockito core'}Robert,这个答案对我很有帮助,感谢您在github中提出的问题。