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. POJ 1410 判断线段与矩形交点或在矩形内

    这个题目要注意的是:给出的矩形坐标不一定是按照左上,右下这个顺序的 #include <iostream> #include <cstdio> #include <cst ...

  2. 配置tomcat虚拟主机

    实例说明 本实例介绍如何配置tomcat的虚拟主机. 关键技术 关于server.xml中host这个元素,只有在设置虚拟主机是才会修改.虚拟主机是一种在一个Web服务器上服务多个域名的机制,对这个域 ...

  3. centos 8.3安装 一键安装部署gitlab

    安装和配置gitlab必须的依赖包 [root@gitlabdev ~]#dnf install -y curl policycoreutils openssh-server perl 设置开机自启s ...

  4. <mvc:default-servlet-handler/>导致controller失效,报404错误

    最近在做ssm框架整合的一个小项目时,页面跳转一直有404错误,也没有报错提示.然后一步一步去找,终于发现是<mvc:default-servlet-handler/>的原因.如下图所示, ...

  5. redis的基本操作指令

    https://www.cnblogs.com/woshimrf/p/5198361.html

  6. JAVA WEB 用servlet实现分页,思路比较清晰和简单。

    JAVA WEB 用servlet实现分页,思路比较清晰和简单.借鉴了其他大佬的思路.特别感谢. 是我第一次发表博客,如果有什么错误,欢迎大家指出!,谢谢 一.思路分析 前台一定是有类似这种的界面 点 ...

  7. buu [MRCTF2020]keyboard

    密文: ooo yyy ii w uuu ee uuuu yyy uuuu y w uuu i i rr w i i rr rrr uuuu rrr uuuu t ii uuuu i w u rrr ...

  8. SwaggerHub 更快,标准化的API设计软件

    更快,标准化的API设计 在功能强大且直观的编辑器中设计API,该编辑器旨在提高速度和效率,而不会损失设计一致性. SwaggerHub帮助我们简化了设计和实现API的方式-作为一名架构师,我喜欢良好 ...

  9. python 图中找目标并截图

    import numpy as npdef sjjt(xha,sjh,beitu,jl,xx,yy): #检查目标,并将目标指定范围内截图 pull_screenshot(xha,sjh,xx) #p ...

  10. 两人团队项目-石家庄地铁查询系统(web版)psp表

    结对开发_石家庄地铁查询_博客地址:https://www.cnblogs.com/Aduorisk/p/10652917.html 队友:冯利伟 PSP: PSP0 Personal Softwar ...