执行mvn clean package spring-boot:repackage,报错如下:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.3.RELEASE:repackage (default)
on project webapps-api-bid: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.5.3.RELEASE:
repackage failed: Unable to find main class

错误提示:

repackage failed: Unable to find main class

原因:

多模块打包时,如果项目模块包含common,core等模块,这些模块不需要启动,应把其打成不可执行包来使用那当我们在maven中有多重依赖时,应注意一点,Common打包出来的应该是不可执行的jar包,所以不要在Common的pom中定义spring-boot-maven-plugin插件。

项目
yixue(父类工程,定义各模块,指定模块依赖jar版本)
|------------------------------
|--yixue-admin 后台用户注册
|
|--yixue-course 后台视频管理
|
|--yixue-commom common工具包,维护工具类,公共类
|
|--yixue-ui web界面,请求跳转,拦截等
|
|--yixue-eureka SpringCloud注册

解决方法:

common项目中除了必要的依赖包以外,maven打包的插件不要再添加一遍了,因为这个SpringBoot插件会在Maven的package后进行二次打包,目的为了生成可执行jar包,如果C中定义了这个插件,会报错提示没有找到main函数

简单来说,如果你的root:`<parent></parent>`项目已经添加了`spring-boot-maven-plugin`插件,那么common就别依赖root了,自己包含一些必要的依赖包,之后别手动添加打包插件即可,如果打包还是失败的话,对root项目clean再install一下,之后应该没有什么问题了

springCloud多模块打包时报错问题的更多相关文章

  1. maven:打包时报错,报’找不到符号’

    参考文章:https://www.cnblogs.com/kelly-one/p/7349930.html 问题描述: 工程开发调试都没有问题,就是不能导出WAR包,用mvn clean packag ...

  2. ionic2 打包时报错 file-opener2

    在app自动更新过程中,有用到ionic-native插件:cordova-plugin-file-openner2    添加插件后,打包时有错: FAILURE: Build failed wit ...

  3. Unity3d 打包时报错 CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.

    今天打包带有Android插件的unity3d 项目是,报错CommandInvokationFailure: Unable to convert classes into dex format. S ...

  4. 【maven】在IDEA上 使用maven进行打包时报错:Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:jar

    报错内容如下: [INFO] ------------------------------------------------------------------------ [INFO] BUILD ...

  5. 在IDEA上 使用maven进行打包时报错: Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.2:jar

    报错内容: Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.2:jar (attach-javado ...

  6. maven打包时报错:-source 1.5 中不支持 diamond 运算符

    报错现象: 解决方法: 在pom文件中加入下面依赖 <build> <plugins> <plugin> <groupId>org.apache.mav ...

  7. vue使用swiper模块滑动时报错:[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example becaus

    报错: vue报这个错 [Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for ex ...

  8. springcloud初次zuul超时报错com.netflix.zuul.exception.ZuulException:Forwarding error

    报错如下 com.netflix.zuul.exception.ZuulException:Forwarding error Caused by: com.netflix.hystrix.except ...

  9. iOS之上架打包时报错:ERROR ITMS-90086: "Missing 64-bit support.

    根据错误信息在网上基本找到的解决方法是设置targets中build settings中的architectures中的内容 这是因为现在提交的app必须支持64位.  

随机推荐

  1. Centos6.6 安装基于系统认证的vsftp服务

    一.介绍 vsftp是一款文件服务器软件,在文件共享,代码更新,文件备份中也是经常用到,以下是基本安装环境: 1)CentOS6.6 2)vsftpd-2.2.2 二.安装 $ yum install ...

  2. (转)Quartz任务调度(1)概念例析快速入门

    http://blog.csdn.net/qwe6112071/article/details/50991563 Quartz框架需求引入 在现实开发中,我们常常会遇到需要系统在特定时刻完成特定任务的 ...

  3. mysql zip版本如何安装

    1.下载mysqlzip包并解压到D:\javadeveloper\mysql-5.6.24-winx642.配置环境变量在path中添加路径 D:\javadeveloper\mysql-5.6.2 ...

  4. iDRAC RAC0218 最大会话限制

    用ssh工具登陆IDRAC远程管理ip地址: /admin1-> racadm racreset RAC reset operation initated successfully.  It m ...

  5. @RequestMapping与controller方法返回值介绍

    @RequestMapping url映射:定义controller方法对应的url,进行处理器映射使用.@RequestMapping(value="/item")或@Reque ...

  6. vue移动端地址三级联动组件(一)

    vue移动端地区三级联动 省,市,县.用的vue+mintUi 因为多级联动以及地区的规则比较多.正好有时间自己写了一个.有问题以及建议欢迎指出.涉及到dom移动,所以依赖vue+jquery.这边数 ...

  7. c/c++排坑(2) -- c语言中的符号重载

    所谓的符号重载就是在不同的上下文环境里有不同的意义.甚至有些关键字也被重载而具有好几种意义,这也是C语言的作用域规则对程序员不那么清晰的主要原因. 本章内容摘自<c专家编程>P37. 大家 ...

  8. Maven中更改默认JDK版本

    只要在settings.xml文件中加上如下标签即可.(我这里是默认的1.7版本) <profiles> <profile> <id>jdk-1.7</id& ...

  9. C语言指针与指向指针的指针

    #include <stdio.h> #include <string.h> int main() { char a[]="hello world"; ch ...

  10. Windows环境下flask+Apache+mod_wsgi部署及爬坑

    文章目录 安装python Windows 环境使用virtualenv和virtualenvwrapper 安装mod_wsgi 安装nginx 安装Apache 遇到的坑 安装Apache遇到的坑 ...