Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:run

版权声明:欢迎转载,注明出处即可,谢谢! https://blog.csdn.net/qq_17231297/article/details/79815964
今天给同事部署一个springboot的项目,项目采用的是springboot的maven插件
 spring-boot-maven-plugin进行run的,用了插件的goal:spring-boot:run来启动项目的,结果一直报错:

 [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:run (default-cli) on project beijing-ces: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:run failed: Unable to load the mojo 'run' in the plugin 'org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/springframework/boot/maven/RunMojo : Unsupported major.minor version 52.0

被上面的这个bug折磨了一上午,主要原因:由于spring-boot-maven-plugin版本不一致造成的,当时没有仔细看上面的问题,认真点应该会很快解决的。有个假象一直误导的我,因为这个项目在6个月以前(2017.10月左右)在我本地部署,部署很顺利,谁知道短短6个月,maven远程中央仓库spring-boot-maven-plugin这个jar发生了很大的变化,我们项目路中pom文件中对这个jar没有指定版本,默认使用的是最新的,当时我更新到最新的是1.5.6【看我的本地仓库确认的版本号】,今天给同事跟新到最新的是2.0.0(报的bug中有提示),不认为变化这么大,忽视版本问题。只能是2.0.0这个版本对我们

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>

</plugin>

上面配置不指定默认下载的最新的


解决办法:

<plugin>
<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-maven-plugin</artifactId>

       <version>1.5.9.RELEASE</version>

</plugin>

提示:建议使用1.5.9及以下的版本,2.0.0变化比较大,除非修改项目(稳定想哭不建议修改)

更多精彩请文章和资源,请关注下面微信公众号!



猜你喜欢

转载自blog.csdn.net/qq_17231297/article/details/79815964