问题再现

在进行mvn打包的时候出现:

Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.1.RELEASE:repackage (repackage) on project service_base: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.2.1.RELEASE:repackage failed: Unable to find main class

原因分析

项目里面包含了某些工具类的模块,而工具类模块是没有main启动类,但是父工程的pom文件却引用了 springboot默认打包插件 spring-boot-maven-plugin, 所以在打包的时候maven会扫描所有的依赖模块,如果发现某个模块下面没有main启动类,就会报错。

解决办法

父工程配置Apache的编译插件

 <build><plugins><!--编译插件--><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>1.8</source><target>1.8</target></configuration></plugin></plugins></build>

需要打包的工程配置springboot打包插件

  <build><plugins><!-- springboot maven打包--><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build>

问题解决


maven打包异常-Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.1.RELEAS相关推荐

  1. 使用idea进行Maven打包异常:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war

    使用idea进行Maven打包异常:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war 参考文章: (1) ...

  2. Maven打包出现:Filed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.2.RELEASE:

    Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.2.RELEASE:repack 由于添加了该 ...

  3. Maven打包时报Failed to execute goal org.apache.maven.plugins:maven-war-plugin:解决方案

    问题现象: 用Maven打包时,报Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war错误. 原因分析: 打 ...

  4. springboot maven 打包失败 Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2

    maven 打包失败 一.问题描述: idea打包springboot项目,控制台提示: Failed to execute goal org.apache.maven.plugins:maven-s ...

  5. maven bug之Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (defau

    maven bug之Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (defau ...

  6. maven 出现:Failed to execute goal on project...Could not resolve dependencies for project

    最近一个 maven 聚合工程出现了这个错误 尝试过的解决方案-但都无效 然后在网上尝试了各种方案,比如如下的解决方案: maven出现:Failed to execute goal on proje ...

  7. 在进行mvn打包的时候出现:Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.1.RELEAS

    谷粒学院报错(一)解决 谷粒学院项目在使用mvn打包时报错: Failed to execute goal org.springframework.boot:spring-boot-maven-plu ...

  8. Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:repackage (de

    使用maven 打包时报错. 错误信息: [INFO] ------------------------------------------------------------------------ ...

  9. Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.0:repackage (repackage)

    异常信息: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.0:repackage (repa ...

最新文章

  1. Java实现反向输出链表
  2. XMC-GAN:从文本到图像的跨模态对比学习
  3. IOS CoreImage实现人脸识别
  4. 关于反射调用方法的一个log
  5. flink下载以及兼容性问题
  6. c调用其他类的方法_吊打面试官-类加载器
  7. SpringBoot启动流程解析
  8. VBscript读取excel表,中数据导入到SQLserver数据库里面
  9. javascript中对象的深度克隆
  10. EditText有焦点(focusable为true)阻止输入法弹出
  11. vue进入页面加载数据缓慢实现loading提示
  12. 中国农村统计年鉴合集(1985-2019年)
  13. 前端入门视频笔记 CSS3(一) P61-92
  14. #3,Android Studio Android开发APP的开发语言和APP连接的数据库 总结
  15. Caused by: java.lang.ClassNotFoundException: org.jbpm.pvm.internal.processengine.SpringHelper
  16. CCF: 201409-1-相邻数对(C++)
  17. d作者d语言中组件式编程
  18. 数据可视化--实验五:高维非空间数据可视化
  19. 毕业设计 推荐系统设计与实现 协同过滤推荐算法
  20. 虚拟机防火墙关了怎么端口还是不能访问

热门文章

  1. python 爬虫 学习笔记
  2. iOS Platform文件百度云盘下载地址
  3. 强化学习用于推荐系统 相关资料
  4. R语言高清图片输出设置
  5. 航向角,横摆角,车辆质心侧偏角,前轮侧偏角(这又可以分为在轮胎坐标系下和车辆坐标系下的前轮侧偏角哦),前轮转角
  6. DMA 请求/应答协议
  7. 关于DELL Precision 7550设置U盘启动的方法
  8. 为什么越来越多年轻人,想去或者留在成都?
  9. 一文纵览EMAS 到底内含多少阿里核心技术能力
  10. 【小波分析】七、小波分析与非线性逼近(下)