换了依赖后项目启动失败:
***************************
APPLICATION FAILED TO START
***************************Description:
An attempt was made to call the method org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;)Ljava/util/Optional; but it does not exist. Its class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:
jar:file:/D:/szw/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar!/org/springframework/plugin/core/PluginRegistry.class
It was loaded from the following location:
....
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry
Disconnected from the target VM, address: '127.0.0.1:55054', transport: 'socket'
idea解决方法:
点开maven视图
Show Dependencies按钮
,打开maven依赖树依赖树:
ctrl+鼠标左键可拖动放大,点击鼠标右键,呼出右键菜单栏,然后点击
Actual Size也可以放大
在项目依赖图中,有一些红色标记的线,实际上,这些红色标记出来的线所指向的 jar 包,就是项目中冲突的 jar 包!且在我们点击 jar 包之后,还会显示出多条指向 jar 包的红色虚线,其代表着该 jar 包被多次引用,及具体引用路径
想要排除冲突的 jar 包,其方法为:点击冲突的 jar 包,右键呼出菜单栏,点击
Exclude
选项。在排除冲突的 jar 包之后,pom.xml
文件会自动更新,添加排除语句。
好了,一顿操作,发现问题并没有解决!!!,嗯,那看下报错信息
发现是找不到:org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar
去本地仓库,看看是存在该jar包的,最后发现是依赖版本冲突的问题,将springboot的版本从2.0降到了1.5
成功启动!或升级为2.3.4.RELEASE也可成功启动