我正在尝试将Spring Boot 2.1.3项目迁移到拼图模块结构。 Maven构建可以正常工作,并且构建的jar可以毫无问题地运行,但是,在IDEA内部直接启动应用程序失败:
Error:java: the unnamed module reads package javax.annotation from both java.annotation and jsr305
Error:java: the unnamed module reads package org.aspectj.internal.lang.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: the unnamed module reads package org.aspectj.internal.lang.annotation from both org.aspectj.runtime and org.aspectj.weaver
Error:java: the unnamed module reads package org.aspectj.runtime from both org.aspectj.runtime and org.aspectj.weaver
Error:java: the unnamed module reads package org.aspectj.runtime.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: the unnamed module reads package org.aspectj.runtime.internal from both org.aspectj.runtime and org.aspectj.weaver
Error:java: the unnamed module reads package org.aspectj.runtime.internal.cflowstack from both org.aspectj.runtime and org.aspectj.weaver
Error:java: the unnamed module reads package org.aspectj.lang from both org.aspectj.runtime and org.aspectj.weaver
Error:java: the unnamed module reads package org.aspectj.lang.internal.lang from both org.aspectj.runtime and org.aspectj.weaver
Error:java: the unnamed module reads package org.aspectj.lang.annotation from both org.aspectj.runtime and org.aspectj.weaver
Error:java: the unnamed module reads package org.aspectj.lang.annotation.control from both org.aspectj.runtime and org.aspectj.weaver
Error:java: the unnamed module reads package org.aspectj.lang.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: the unnamed module reads package org.springframework.security.crypto.util from both spring.security.crypto and spring.security.core
Error:java: the unnamed module reads package org.springframework.security.crypto.encrypt from both spring.security.crypto and spring.security.core
Error:java: the unnamed module reads package org.springframework.security.crypto.factory from both spring.security.crypto and spring.security.core
Error:java: the unnamed module reads package org.springframework.security.crypto.keygen from both spring.security.crypto and spring.security.core
Error:java: the unnamed module reads package org.springframework.security.crypto.codec from both spring.security.crypto and spring.security.core
Error:java: the unnamed module reads package org.springframework.security.crypto.bcrypt from both spring.security.crypto and spring.security.core
Error:java: the unnamed module reads package org.springframework.security.crypto.scrypt from both spring.security.crypto and spring.security.core
Error:java: the unnamed module reads package org.springframework.security.crypto.password from both spring.security.crypto and spring.security.core
Error:java: module spring.web reads package javax.annotation from both java.annotation and jsr305
Error:java: module spring.web reads package org.aspectj.internal.lang.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.web reads package org.aspectj.internal.lang.annotation from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.web reads package org.aspectj.runtime from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.web reads package org.aspectj.runtime.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.web reads package org.aspectj.runtime.internal from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.web reads package org.aspectj.runtime.internal.cflowstack from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.web reads package org.aspectj.lang from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.web reads package org.aspectj.lang.internal.lang from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.web reads package org.aspectj.lang.annotation from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.web reads package org.aspectj.lang.annotation.control from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.web reads package org.aspectj.lang.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.web reads package org.springframework.security.crypto.util from both spring.security.crypto and spring.security.core
Error:java: module spring.web reads package org.springframework.security.crypto.encrypt from both spring.security.crypto and spring.security.core
Error:java: module spring.web reads package org.springframework.security.crypto.factory from both spring.security.crypto and spring.security.core
Error:java: module spring.web reads package org.springframework.security.crypto.keygen from both spring.security.crypto and spring.security.core
Error:java: module spring.web reads package org.springframework.security.crypto.codec from both spring.security.crypto and spring.security.core
Error:java: module spring.web reads package org.springframework.security.crypto.bcrypt from both spring.security.crypto and spring.security.core
Error:java: module spring.web reads package org.springframework.security.crypto.scrypt from both spring.security.crypto and spring.security.core
Error:java: module spring.web reads package org.springframework.security.crypto.password from both spring.security.crypto and spring.security.core
Error:java: module spring.data.jpa reads package javax.annotation from both java.annotation and jsr305
Error:java: module spring.data.jpa reads package org.aspectj.internal.lang.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.data.jpa reads package org.aspectj.internal.lang.annotation from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.data.jpa reads package org.aspectj.runtime from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.data.jpa reads package org.aspectj.runtime.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.data.jpa reads package org.aspectj.runtime.internal from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.data.jpa reads package org.aspectj.runtime.internal.cflowstack from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.data.jpa reads package org.aspectj.lang from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.data.jpa reads package org.aspectj.lang.internal.lang from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.data.jpa reads package org.aspectj.lang.annotation from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.data.jpa reads package org.aspectj.lang.annotation.control from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.data.jpa reads package org.aspectj.lang.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.data.jpa reads package org.springframework.security.crypto.util from both spring.security.crypto and spring.security.core
Error:java: module spring.data.jpa reads package org.springframework.security.crypto.encrypt from both spring.security.crypto and spring.security.core
Error:java: module spring.data.jpa reads package org.springframework.security.crypto.factory from both spring.security.crypto and spring.security.core
Error:java: module spring.data.jpa reads package org.springframework.security.crypto.keygen from both spring.security.crypto and spring.security.core
Error:java: module spring.data.jpa reads package org.springframework.security.crypto.codec from both spring.security.crypto and spring.security.core
Error:java: module spring.data.jpa reads package org.springframework.security.crypto.bcrypt from both spring.security.crypto and spring.security.core
Error:java: module spring.data.jpa reads package org.springframework.security.crypto.scrypt from both spring.security.crypto and spring.security.core
Error:java: module spring.data.jpa reads package org.springframework.security.crypto.password from both spring.security.crypto and spring.security.core
Error:java: module spring.context reads package javax.annotation from both java.annotation and jsr305
Error:java: module spring.context reads package org.aspectj.internal.lang.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.context reads package org.aspectj.internal.lang.annotation from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.context reads package org.aspectj.runtime from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.context reads package org.aspectj.runtime.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.context reads package org.aspectj.runtime.internal from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.context reads package org.aspectj.runtime.internal.cflowstack from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.context reads package org.aspectj.lang from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.context reads package org.aspectj.lang.internal.lang from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.context reads package org.aspectj.lang.annotation from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.context reads package org.aspectj.lang.annotation.control from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.context reads package org.aspectj.lang.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.context reads package org.springframework.security.crypto.util from both spring.security.crypto and spring.security.core
Error:java: module spring.context reads package org.springframework.security.crypto.encrypt from both spring.security.crypto and spring.security.core
Error:java: module spring.context reads package org.springframework.security.crypto.factory from both spring.security.crypto and spring.security.core
Error:java: module spring.context reads package org.springframework.security.crypto.keygen from both spring.security.crypto and spring.security.core
Error:java: module spring.context reads package org.springframework.security.crypto.codec from both spring.security.crypto and spring.security.core
Error:java: module spring.context reads package org.springframework.security.crypto.bcrypt from both spring.security.crypto and spring.security.core
Error:java: module spring.context reads package org.springframework.security.crypto.scrypt from both spring.security.crypto and spring.security.core
Error:java: module spring.context reads package org.springframework.security.crypto.password from both spring.security.crypto and spring.security.core
Error:java: module spring.boot.autoconfigure reads package javax.annotation from both java.annotation and jsr305
Error:java: module spring.boot.autoconfigure reads package org.aspectj.internal.lang.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.boot.autoconfigure reads package org.aspectj.internal.lang.annotation from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.boot.autoconfigure reads package org.aspectj.runtime from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.boot.autoconfigure reads package org.aspectj.runtime.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.boot.autoconfigure reads package org.aspectj.runtime.internal from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.boot.autoconfigure reads package org.aspectj.runtime.internal.cflowstack from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.boot.autoconfigure reads package org.aspectj.lang from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.boot.autoconfigure reads package org.aspectj.lang.internal.lang from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.boot.autoconfigure reads package org.aspectj.lang.annotation from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.boot.autoconfigure reads package org.aspectj.lang.annotation.control from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.boot.autoconfigure reads package org.aspectj.lang.reflect from both org.aspectj.runtime and org.aspectj.weaver
Error:java: module spring.boot.autoconfigure reads package org.springframework.security.crypto.util from both spring.security.crypto and spring.security.core
Error:java: module spring.boot.autoconfigure reads package org.springframework.security.crypto.encrypt from both spring.security.crypto and spring.security.core
Error:java: module spring.boot.autoconfigure reads package org.springframework.security.crypto.factory from both spring.security.crypto and spring.security.core
Error:java: module spring.boot.autoconfigure reads package org.springframework.security.crypto.keygen from both spring.security.crypto and spring.security.core
Error:java: module spring.boot.autoconfigure reads package org.springframework.security.crypto.codec from both spring.security.crypto and spring.security.core
Error:java: module spring.boot.autoconfigure reads package org.springframework.security.crypto.bcrypt from both spring.security.crypto and spring.security.core
Error:java: module spring.boot.autoconfigure reads package org.springframework.security.crypto.scrypt from both spring.security.crypto and spring.security.core
Error:java: module spring.boot.autoconfigure reads package org.springframework.security.crypto.password from both spring.security.crypto and spring.security.core
我尝试为IntelliJ IDEA重新编制索引,但没有成功。项目JDK和语言级别设置为java11。
带有编译器插件3.8.0的Maven 3.6.0可以构建我的服务的工作jar,而不会出现任何警告或错误。
项目结构
├── pom.xml
└── src
├── assembly
│ └── assembly.xml
└── main
└── java
├── com
│ └── myapp
│ └── Application.java
└── module-info.java
我的module-info.java
module com.myapp {
// Spring
requires spring.boot;
requires spring.boot.autoconfigure;
requires spring.context;
requires spring.data.jpa;
requires spring.web;
requires slf4j.api;
requires lombok;
// Internal
requires com.internaldependency;
}
我猜测这是我的IntelliJ设置或项目结构存在的问题,因为maven构建起作用了。