Plugin ‘org.springframework.boot:spring-boot-maven-plugin:’ not found报错解决方法:
我自己的代码:
<dependencies> <!-- web场景启动器--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- springboot单元测试 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <!-- 剔除依赖 --> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> <build> <plugins> <!-- 打包插件 --> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
许多文章里面说到如下这种解决方式:
往里面添加
<version>2.2.6.RELEASE</version> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions>
我用了这种方式后发现没用,不过有些小伙伴应该有用。如果没用可以尝试我下面这一种。
然后呢,emmm,依然是没能解决spring-boot-maven-plugin not found的问题,Re import也不起作用,很是郁闷。
最后去继续找资料,然后看到一篇博主写的。去maven中央仓库里翻到了最新版本的jar包依赖:
https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-maven-plugin
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.4.0</version> </dependency>
添加到依赖里,再Re import就可以了,至此解决问题!
最后你的问题就解决了哦