maven打包异常-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-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相关推荐
- 使用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) ...
- 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 由于添加了该 ...
- 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错误. 原因分析: 打 ...
- 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 ...
- 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 ...
- maven 出现:Failed to execute goal on project...Could not resolve dependencies for project
最近一个 maven 聚合工程出现了这个错误 尝试过的解决方案-但都无效 然后在网上尝试了各种方案,比如如下的解决方案: maven出现:Failed to execute goal on proje ...
- 在进行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 ...
- Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:repackage (de
使用maven 打包时报错. 错误信息: [INFO] ------------------------------------------------------------------------ ...
- 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 ...
最新文章
- Java实现反向输出链表
- XMC-GAN:从文本到图像的跨模态对比学习
- IOS CoreImage实现人脸识别
- 关于反射调用方法的一个log
- flink下载以及兼容性问题
- c调用其他类的方法_吊打面试官-类加载器
- SpringBoot启动流程解析
- VBscript读取excel表,中数据导入到SQLserver数据库里面
- javascript中对象的深度克隆
- EditText有焦点(focusable为true)阻止输入法弹出
- vue进入页面加载数据缓慢实现loading提示
- 中国农村统计年鉴合集(1985-2019年)
- 前端入门视频笔记 CSS3(一) P61-92
- #3,Android Studio Android开发APP的开发语言和APP连接的数据库 总结
- Caused by: java.lang.ClassNotFoundException: org.jbpm.pvm.internal.processengine.SpringHelper
- CCF: 201409-1-相邻数对(C++)
- d作者d语言中组件式编程
- 数据可视化--实验五:高维非空间数据可视化
- 毕业设计 推荐系统设计与实现 协同过滤推荐算法
- 虚拟机防火墙关了怎么端口还是不能访问