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

https://www.baidu.com/link?url=jyRu_B0z-XhN69mUmTDDJC4p1dOnk8IxODdcj5465c5F9jLc2GtDJ12DPk7GORg9&wd=&eqid=eeb204500021c96d000000045de8ac9a

springboot打包问题的更多相关文章

  1. springboot 打包

    springboot 打包 先clean 然后 maven package 通过命令java -jar target/GoshenWepPro-0.1.0.jar运行程序

  2. springboot打包不同环境配置与shell脚本部署

    本篇和大家分享的是springboot打包并结合shell脚本命令部署,重点在分享一个shell程序启动工具,希望能便利工作: profiles指定不同环境的配置 maven-assembly-plu ...

  3. SpringBoot打包成war

    关于SpringBoot打成jar包以及jar包如何在Linux持久运行,我在前面已经说过了,所以本次不再赘述. 关于SpringBoot打包成war,其实步骤特别简单,如下图所示(如果是jar,通常 ...

  4. springboot打包去除资源文件,启动时指定配置文件位置,使用log4j2替换默认logback

    springboot打包时,去掉资源文件 <build> <resources> <resource> <directory>src/main/reso ...

  5. springboot打包成war后部署项目出现异常 LifecycleException: Failed to start component

    完整异常:org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].Sta ...

  6. springboot打包成jar包后找不到xml,找不到主类的解决方法

    springboot打包成jar包后找不到xml,找不到主类的解决方法 请首先保证你的项目能正常运行(即不打包的时候运行无误),我们在打包时经常遇到如下问题: springboot打包成jar包后找不 ...

  7. SpringBoot 打包为Docker进行

    可以有两种方式: 1.dockerfile 2.maven docker 第一种方式:通过dockerfile打包Docker镜像 1.将dockerfile和 springboot打包的jar文件放 ...

  8. 聚合maven+spring-boot打包可执行jar

    整整搞了一天,终于解决这个问题了.这里是四个module,module之间存在依赖,打包两个可执行jar,看下最终效果吧 聚合maven+spring-boot的搭建很简单,和普通的聚合maven没有 ...

  9. 关于springboot 打包问题 jar包和 war包

    起因:项目开发完成   需要打包部署了  发现自己不会打包 那么开始网上学习打包? 那么怎么来打包那? 我们以前没有采用springboot 时候我们都是直接将项目打成war包形式  然后放到tomc ...

  10. Springboot打包执行源码解析

    一.打包 Springboot打包的时候,需要配置一个maven插件[spring-boot-maven-plugin] <build> <plugins> <plugi ...

随机推荐

  1. python导入模块--案例

    1 导入模块 1.1 问题 本案例要求先编写一个star模块,主要要求如下: 建立工作目录 ~/bin/ 创建模块文件 ~/bin/star.py 模块中创建pstar函数,实现打印50个星号的功能 ...

  2. [心得笔记]spring常用的三种依赖注入方式

    一.目前使用最广泛的 @Autowired:自动装配 基于@Autowired的自动装配,默认是根据类型注入,可以用于构造器.接口.方法注入,使用方式如下: @Autowired 构造方法.方法.接口 ...

  3. Auto update Python 2.x to 3.x

    1, How to check the python version import sys if sys.version_info < (3.0)     print ("python ...

  4. 18 shell 重定向以及文件描述符

    1.对重定向的理解 2.硬件设备和文件描述符 文件描述符到底是什么 3.Linux Shell 输出重定向 4.Linux Shell 输入重定向 5.结合Linux文件描述符谈重定向 6.Shell ...

  5. 在Ubuntu 16.04中搭建RobotFramework环境

    1.搭建RF环境 2.安装RF相关库 3.查看RF case 4.设置环境变量 相关知识点:pip  --proxy=http://xx.xx.xx.xx:xx install 包名,使用pip的-- ...

  6. MOS管开关电路笔记

    1.MOS管开关电路是利用MOS管栅极(g)控制MOS管源极(s)和漏极(d)通断的原理构造的电路.MOS管分为N沟道与P沟道,所以开关电路也主要分为两种.P沟道或N沟道共四种类型,但实际应用的只有增 ...

  7. 使用Nginx和uwsgi部署Flask项目

    前言   之前用Flask框架开发了一个Python的Web项目,使用Nginx和uWSGI部署起来感觉挺麻烦,过程中还因为对Flask框架的不熟悉,花了好长时间才把应用完全部署起来.下面分享部署成功 ...

  8. Python - 基本数据类型_str 字符串

    前言 字符串是编程中最重要的数据类型,也是最常见的 字符串的表示方式 单引号 ' ' 双引号 " " 多引号 """ ""&quo ...

  9. C语言:编译具体过程及隐藏

    对于平常应用程序的开发,很少有人会关注编译和链接的过程,因为我们使用的工具一般都是流行的集成开发环境(IDE),比如 Visual Studio.Dev C++.C-Free 等.这些功能强大的 ID ...

  10. Hector SLAM解读(1)原文翻译

      一种带有3D运动状态估计的slam系统 A Flexible and Scalable SLAM System with Full 3D Motion Estimation 摘要: 在许多应用场景 ...