错误详情如下
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call the method (Ljava/lang/Object;)Ljava/util/Optional; but it does not exist. Its class, , is available from the following locations:
jar:file:/C:/programs/maven/localHouse/org/springframework/plugin/spring-plugin-core/1.2./spring-plugin-core-1.2.!/org/springframework/plugin/core/
It was loaded from the following location:
file:/C:/programs/maven/localHouse/org/springframework/plugin/spring-plugin-core/1.2./spring-plugin-core-1.2.
Action:
Correct the classpath of your application so that it contains a single, compatible version of
按照错误提示,怀疑是包冲突,于是执行mvn dependency:tree >
进行maven
依赖查看,结果spring-plugin-core 1.2.0-RELEASE
只有springfox
在使用(即Swagger3
),所以并不存在冲突的问题
解决方案:强制将依赖版本升级到2.0,问题解决
<dependency>
<groupId></groupId>
<artifactId>spring-plugin-core</artifactId>
<version>2.0.</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>spring-plugin-metadata</artifactId>
<version>2.0.</version>
</dependency>