springboot打包问题
pom.xml
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.1.RELEASE:repackage (default) on project demo-common: Execution default of
goal org.springframework.boot:spring-boot-maven-plugin:2.2.1.RELEASE:repackage failed: Unable to find main class -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :demo-common
错误原因就是没有找到main方法,整个demo-common没有启动入口。
但是它作为核心依赖jar包,又没有参与业务,所以没有给它提供main方法的启动类。
解决办法:
去掉当前项目pom中的spring-boot-maven-plugin插件
spring-boot-maven-plugin用于给jar将依赖的第三方jar打包到当前jar中
注:
继承spring-boot-starter-parent的springboot项目不用添加主类和设置repackage
springboot打包问题的更多相关文章
- springboot 打包
springboot 打包 先clean 然后 maven package 通过命令java -jar target/GoshenWepPro-0.1.0.jar运行程序
- springboot打包不同环境配置与shell脚本部署
本篇和大家分享的是springboot打包并结合shell脚本命令部署,重点在分享一个shell程序启动工具,希望能便利工作: profiles指定不同环境的配置 maven-assembly-plu ...
- SpringBoot打包成war
关于SpringBoot打成jar包以及jar包如何在Linux持久运行,我在前面已经说过了,所以本次不再赘述. 关于SpringBoot打包成war,其实步骤特别简单,如下图所示(如果是jar,通常 ...
- springboot打包去除资源文件,启动时指定配置文件位置,使用log4j2替换默认logback
springboot打包时,去掉资源文件 <build> <resources> <resource> <directory>src/main/reso ...
- springboot打包成war后部署项目出现异常 LifecycleException: Failed to start component
完整异常:org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].Sta ...
- springboot打包成jar包后找不到xml,找不到主类的解决方法
springboot打包成jar包后找不到xml,找不到主类的解决方法 请首先保证你的项目能正常运行(即不打包的时候运行无误),我们在打包时经常遇到如下问题: springboot打包成jar包后找不 ...
- SpringBoot 打包为Docker进行
可以有两种方式: 1.dockerfile 2.maven docker 第一种方式:通过dockerfile打包Docker镜像 1.将dockerfile和 springboot打包的jar文件放 ...
- 聚合maven+spring-boot打包可执行jar
整整搞了一天,终于解决这个问题了.这里是四个module,module之间存在依赖,打包两个可执行jar,看下最终效果吧 聚合maven+spring-boot的搭建很简单,和普通的聚合maven没有 ...
- 关于springboot 打包问题 jar包和 war包
起因:项目开发完成 需要打包部署了 发现自己不会打包 那么开始网上学习打包? 那么怎么来打包那? 我们以前没有采用springboot 时候我们都是直接将项目打成war包形式 然后放到tomc ...
- Springboot打包执行源码解析
一.打包 Springboot打包的时候,需要配置一个maven插件[spring-boot-maven-plugin] <build> <plugins> <plugi ...
随机推荐
- CentOS-Docker搭建Nacos-v1.3.2(单点)
说明:从v1.3.1版本开始支持自定义mysql-8.x 通用属性配置(v1.3.2) name description option MODE cluster模式/standalone模式 clus ...
- Spring缓存的注解关键词解释
Spring缓存的注解关键词解释 @Cacheable支持缓存 @Cacheable可以标记在一个方法上,也可以标记在一个类上. 1.当标记在一个方法上时表示该方法是支持缓存的,当标记在一个类上时则表 ...
- python之学生信息管理系统
1 #!usr/bin/python 2 #encoding=utf-8 3 4 #1. 打印学生管理系统界面 5 def printStd(): 6 print ("*"*50) ...
- 使用Hugo框架搭建博客的过程 - 前期准备
前言 这篇教程介绍了如何搭建这样效果的博客. 所需步骤 可以从这样的角度出发: 注册域名. 使用CDN加快网站访问速度. 网站内容需要部署在服务器或对象存储平台上. 重要的是放什么内容.博客需要选择框 ...
- postgresql行列转换
--安装扩展 CREATE EXTENSION tablefunc --使用CROSSTAB函数 SELECT * FROM CROSSTAB('SELECT 主键, 需转换的列名, 需转换的列值 F ...
- SEO入门一篇就够-SEO教程
大家口中的SEO(Search Engine Optimization),中文翻译为"搜索引擎优化",从本质上来说,其实就是如何迎合搜索引擎的规则,使得网站在搜索结果中能有更好的排 ...
- Activiti7 回退与会签
1. 回退(驳回) 回退的思路就是动态更改节点的流向.先遇水搭桥,最后再过河拆桥. 具体操作如下: 取得当前节点的信息 取得当前节点的上一个节点的信息 保存当前节点的流向 新建流向,由当前节点指向上 ...
- python3执行.sql文件
这个脚本主要是遍历执行文件夹下的sql文件,但是没有辨别文件的格式,所以文件夹下只能够放.sql文件,否则会报错哈. 我的sql文件夹与执行的文件平级,所以dir_path就是sql,大家依照自己的路 ...
- 什么是 BPMN ?为什么我们要用 BPMN 和工作流 ?
BPMN 和 Activiti 介绍 工作流介绍 在任何行业和企业中,都有各种各样的流程,例如: 请假流程 报销流程 入职流程 离职流程 出差流程 等等-- 就算你自己没有设计过工作流,那么你每天肯定 ...
- 开发工具IDE从入门到爱不释手(三)运行与调试
一.启动项目 右键运行 菜单运行 run窗口运行 启动参数 -D可覆盖,application.properties中的配置 如: 自动编译 二.调试项目 断点调试 蓝色背景的行,就是当前程序停住的行 ...