maven package异常repackage failed: Unable to find main class
现象
模块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相关推荐
- maven testNG打成jar包运行报错repackage failed: Unable to find main class
一.maven testNG如何打jar包 1.pom文件引入插件 <build><plugins><plugin><groupId>org.apach ...
- maven打包repackage failed: Unable to find main class
一.Maven打包Spring Boot项目报错(repackage failed: Unable to find main class),排除寻找Main方法,一般用于被依赖的公用常量模块,解决方法 ...
- springboot项目进行 mvn install 时报错 repackage failed: Unable to find main class 处理记录
异常描述:springboot项目进行 mvn install时 报错如下 Failed to execute goal org.springframework.boot:spring-boot-ma ...
- SpringBoot打包错误(repackage failed: Unable to find main class)
错误代码 多模块的SpringBoot项目打包失败,错误代码如下. [ERROR] Failed to execute goal org.springframework.boot:spring-boo ...
- 项目打包公共模块失败【error:repackage failed: Unable to find main class】
1.背景: 今天给项目打jar包时发现了一个打jar包失败的问题.原因是由于项目的公共包没有main方法导致打包失败,但是我们的公共模块确实不需要main方法,所以需要想办法去掉这项校验,经过查阅资料 ...
- Idea Spring Boot项目提示 repackage failed: Unable to find main class
本人项目是一个多模块的Spring Boot项目,模块打包时一直显示没有找到主类,很奇怪,我项目中其它的模块都可以正常打包 报错内容: Failed to execute goal org.sprin ...
- 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 ...
- 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. ...
- 解决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 ...
最新文章
- jenkins 添加 k8s 云
- CentOS6.5通过jdk8.rpm文件安装JDK8
- php获取curl头_php中CURL请求头和响应头获取方法
- SEED实验系列:ShellShock 攻击实验
- matlab空间曲面拟合,matlab如何进行曲面拟合
- 解放重复劳动丨华为云IoT API Explorer对接小程序实现系统化应用
- 说一下朗数可视化快速开发平台
- The only difference is that they are written
- Fiddler抓取HTTPS最全(强)攻略!
- SQLSERVER事务日志已满 the transaction log for database 'xx' is full
- 网页资源下载 -- 水浒传全集
- Micrium uC-Probe导入.elf文件的问题
- 注册电子邮箱你知道哪家好吗?好用的电子邮箱盘点
- CentOS 某服务器搭建问题收集
- Windows下使用chkdsk修复移动硬盘/磁盘
- 企业想要制作电商类App软件
- Unity3D 车流线
- Python工程师面试必备25条Python知识点
- HBuilder(uniapp) 配置android模拟器
- ASP.NET2.0数据操作之母板页和站点导航