我有两个项目。其中一个如下(称为项目1):
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/>
</parent>
第二个项目(即项目2)如下:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>
<relativePath/>
</parent>
两者都具备以下特点:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
好的,项目1正常运行。我可以在我的.M2仓库文件夹中看到Spring插件v. 2.0.0.BUILD-SNAPSHOT。
项目2出现以下错误:
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call the method org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin; but it does not exist. Its class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:
jar:file:/.../.m2/repository/org/springframework/plugin/spring-plugin-core/2.0.0.BUILD-SNAPSHOT/spring-plugin-core-2.0.0.BUILD-SNAPSHOT.jar!/org/springframework/plugin/core/PluginRegistry.class
It was loaded from the following location:
file:/.../.m2/repository/org/springframework/plugin/spring-plugin-core/2.0.0.BUILD-SNAPSHOT/spring-plugin-core-2.0.0.BUILD-SNAPSHOT.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry
当我试图在项目2的POM中强制指定Maven插件版本时,我看到了经典的黄色警告,提示我正在覆盖托管版本2.2.0.BUILD-SNAPSHOT,但是没有Maven插件的2.2.0版本。
奇怪的是,我昨天还能运行这个项目....
有人能告诉我出了什么问题吗?
注意:当我将项目2降级到2.0.3.RELEASE时,所有东西都开始正常工作。