Spring-boot-maven-plugin未找到

Springboot 项目 pom.xml 中的maven插件突然报错

Plugin org.springframework.boot:spring-boot-maven-plugin: not found

原因应该是原本Springboot的版本和其默认的maven插件依赖版本冲突,只要自己将maven插件依赖的版本改为正在使用的Springboot版本号就解决了

原本没有设置插件版本:

1
2
3
4
5
6
7
8
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

改为 ——》

1
2
3
4
5
6
7
8
9
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.5.7</version>
</plugin>
</plugins>
</build>

这里是版本号对应当前正在使用的Springboot版本

Author: klenq
Link: https://klenq.github.io/2021/11/26/Spring-boot-maven-plugin未找到/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.