[英]Java9 module error: Can not determine the module name, the unnamed module reads package and module org.reactivestreams reads package from both
I am getting 3 different errors.我收到 3 个不同的错误。
what exactly those errors?这些错误究竟是什么?
build.gradle构建.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'
}
Error Message:错误信息:
Task :compileJava任务:编译Java
error: cannot determine module name for /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
错误:无法确定 /Users/srihariprasad/.gradle/caches/modules-2/files-2.1/io.github.resilience4j/resilience4j-framework-common/1.3.1/8c16dda86fad3c9251930cad21ac87aa5/resilience4-common 的模块名称.1.jar
error: the unnamed module reads package io.github.resilience4j.timelimiter.autoconfigure from both resilience4j.spring.boot.common and io.github.resilience4j.springboot2
错误:未命名的模块从resilience4j.spring.boot.common 和io.github.resilience4j.springboot2 读取包io.github.resilience4j.timelimiter.autoconfigure
error: the unnamed module reads package io.github.resilience4j.retry.autoconfigure from both resilience4j.spring.boot.common and io.github.resilience4j.springboot2错误:未命名模块从resilience4j.spring.boot.common 和io.github.resilience4j.springboot2 读取包io.github.resilience4j.retry.autoconfigure
error: the unnamed module reads package io.github.resilience4j.ratelimiter.autoconfigure from both resilience4j.spring.boot.common and io.github.resilience4j.springboot2 error: the unnamed module reads package io.github.resilience4j.circuitbreaker.autoconfigure from both resilience4j.spring.boot.common and io.github.resilience4j.springboot2 error: the unnamed module reads package io.github.resilience4j.bulkhead.autoconfigure from both resilience4j.spring.boot.common and io.github.resilience4j.springboot2错误:未命名模块从resilience4j.spring.boot.common 和io.github.resilience4j.springboot2 读取包io.github.resilience4j.ratelimiter.autoconfigure 错误:未命名模块从io.github.resilience4j.circuitbreaker.autoconfigure 读取包弹性4j.spring.boot.common和io.github.resilience4j.springboot2错误:未命名的模块从resilience4j.spring.boot.common和io.github.resilience4j.springboot2读取包io.github.resilience4j.bulkhead.autoconfigure
error: module org.reactivestreams reads package io.github.resilience4j.timelimiter.autoconfigure from both resilience4j.spring.boot.common and io.github.resilience4j.springboot2
错误:模块org.reactivestreams 从resilience4j.spring.boot.common 和io.github.resilience4j.springboot2 读取包io.github.resilience4j.timelimiter.autoconfigure
how can we find these two modules from which jar, to exclude those.我们如何从哪个 jar 中找到这两个模块,以排除它们。 1.resilience4j.spring.boot.common, 2. io.github.resilience4j.springboot2.
1.resilience4j.spring.boot.common,2.io.github.resilience4j.springboot2。 As per my understanding i need to exclude jars from resilience4j-spring-boot2:1.3.1.
根据我的理解,我需要从resilience4j-spring-boot2:1.3.1中排除罐子。 But i don't understand how to do it?
但我不明白该怎么做?
The packages exported by unnamed module can only be read by another unnamed module.未命名模块导出的包只能被另一个未命名模块读取。 It is not possible that a named module can read (requires) the unnamed module.
命名模块不可能读取(需要)未命名模块。http://tutorials.jenkov.com/java/modules.html#unnamed-module
http://tutorials.jenkov.com/java/modules.html#unnamed-module
You are using Resilience4j as an automatic module, but the rule about not allowing split packages also counts for automatic modules.您使用 Resilience4j 作为自动模块,但不允许拆分包的规则也适用于自动模块。 If multiple JAR files contain (and thus exports) the same Java package, then only one of these JAR files can be used as an automatic module.
如果多个 JAR 文件包含(并因此导出)相同的 Java 包,则这些 JAR 文件中只有一个可以用作自动模块。 We have to fix this split package issue in Resilience4j.
我们必须在 Resilience4j 中修复这个拆分包问题。 Until then you can use the -classpath argument to the Java VM when running an application.
在此之前,您可以在运行应用程序时对 Java VM 使用 -classpath 参数。 On the classpath you can include all your older Java classes, just like you have done before Java 9. All classes found on the classpath will be included in what Java calls the unnamed module.
在类路径中,您可以包含所有较旧的 Java 类,就像您在 Java 9 之前所做的那样。在类路径中找到的所有类都将包含在 Java 称为未命名模块的内容中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.