现象

模块package时出现异常

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

原因

springboot打包时需要制定main入口,在需要打包的maven模块中未找到main入口

处理方案

  • 情况一:需要单独启动的项目,创建启动类,还有其他方法,这里不做重点说明。
@SpringBootApplication
public class App {public static void main(String[] args) {SpringApplication.run(App.class, args);}
}
  • 情况二:工具类,不需要main入口,可以直接删除pom.xml中的build标签;如果是子模块可以使用skip跳过spring打包。
    <build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><skip>true</skip></configuration></plugin></plugins></build>

maven package异常repackage failed: Unable to find main class相关推荐

  1. maven testNG打成jar包运行报错repackage failed: Unable to find main class

    一.maven testNG如何打jar包 1.pom文件引入插件 <build><plugins><plugin><groupId>org.apach ...

  2. maven打包repackage failed: Unable to find main class

    一.Maven打包Spring Boot项目报错(repackage failed: Unable to find main class),排除寻找Main方法,一般用于被依赖的公用常量模块,解决方法 ...

  3. springboot项目进行 mvn install 时报错 repackage failed: Unable to find main class 处理记录

    异常描述:springboot项目进行 mvn install时 报错如下 Failed to execute goal org.springframework.boot:spring-boot-ma ...

  4. SpringBoot打包错误(repackage failed: Unable to find main class)

    错误代码 多模块的SpringBoot项目打包失败,错误代码如下. [ERROR] Failed to execute goal org.springframework.boot:spring-boo ...

  5. 项目打包公共模块失败【error:repackage failed: Unable to find main class】

    1.背景: 今天给项目打jar包时发现了一个打jar包失败的问题.原因是由于项目的公共包没有main方法导致打包失败,但是我们的公共模块确实不需要main方法,所以需要想办法去掉这项校验,经过查阅资料 ...

  6. Idea Spring Boot项目提示 repackage failed: Unable to find main class

    本人项目是一个多模块的Spring Boot项目,模块打包时一直显示没有找到主类,很奇怪,我项目中其它的模块都可以正常打包 报错内容: Failed to execute goal org.sprin ...

  7. jenkins用spring-boot-maven-plugin构建出错:repackage failed: Unable to find main class

    完整的报错信息如下: [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.4.RE ...

  8. spring-boot-maven-plugin:2.3.2.RELEASE:repackage failed: Unable to find main class

    问题 公共包执行install时失败,提示: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3. ...

  9. 解决spring-boot-maven-plugin:2.2.1.RELEASE:repackage failed: Unable to find main class

    解决:Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.2.1.RELEASE:repac ...

最新文章

  1. jenkins 添加 k8s 云
  2. CentOS6.5通过jdk8.rpm文件安装JDK8
  3. php获取curl头_php中CURL请求头和响应头获取方法
  4. SEED实验系列:ShellShock 攻击实验
  5. matlab空间曲面拟合,matlab如何进行曲面拟合
  6. 解放重复劳动丨华为云IoT API Explorer对接小程序实现系统化应用
  7. 说一下朗数可视化快速开发平台
  8. The only difference is that they are written
  9. Fiddler抓取HTTPS最全(强)攻略!
  10. SQLSERVER事务日志已满 the transaction log for database 'xx' is full
  11. 网页资源下载 -- 水浒传全集
  12. Micrium uC-Probe导入.elf文件的问题
  13. 注册电子邮箱你知道哪家好吗?好用的电子邮箱盘点
  14. CentOS 某服务器搭建问题收集
  15. Windows下使用chkdsk修复移动硬盘/磁盘
  16. 企业想要制作电商类App软件
  17. Unity3D 车流线
  18. Python工程师面试必备25条Python知识点
  19. HBuilder(uniapp) 配置android模拟器
  20. ASP.NET2.0数据操作之母板页和站点导航

热门文章

  1. 论文查重的几个小问题
  2. 关于xlsx-style的安装与修改、vue引用xlsx-style组件
  3. 大型分布式网站相关概念及优化
  4. gromacs PCA 做自由能景观图
  5. spring tool suite安装失败的一种解决方案
  6. 精选28页完整版毕业设计PPT文件
  7. Kmeans使用小结
  8. 51单片机 - - 简介
  9. 每天起床第一句,先给自己打个气
  10. hnust - 聊天表情