首页 > 编程语言 > 详细

自定义spring-boot-autocofigure使用maven打包的时候报错了:Failed to execute goal org.springframework.boot:spring-boot-maven-plugin

时间:2021-05-15 19:05:34      阅读:21      评论:0      收藏:0      [点我收藏+]

报错信息如下:

Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.5:repackage (repackage) on project andy-hello-world-spring-boot-starter-autoconfiguration: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.4.5:repackage failed: Unable to find main class

 

原来是我使用spring-initializr创建spring-boot项目的时候,pom.xml中会自动引入spring-boot-maven-plugin插件,这个插件会检查项目中是否有@SpringbootApplication注解修饰的main方法。

删除pom.xml中的如下插件即可

技术分享图片

 

 

另外推荐下尚硅谷的spring-boot自定义starter的视频资料。

https://www.bilibili.com/video/BV19K4y1L7MT?p=83

 

自定义spring-boot-autocofigure使用maven打包的时候报错了:Failed to execute goal org.springframework.boot:spring-boot-maven-plugin

原文:https://www.cnblogs.com/mkl34367803/p/14771169.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!