执行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. quartz 数据库表含义解释

    http://blog.csdn.net/tengdazhang770960436/article/details/51019291 一.表信息解析: 1.1.qrtz_blob_triggers : ...

  2. C# Winform 获得下拉框 选中的值

    string PrintName = cmbPrinter.SelectedIndex.ToString(); PrintName = cmbPrinter.SelectedItem.ToString ...

  3. Django的文件下载

    在实际的项目中很多时候需要用到下载功能,如导excel.pdf或者文件下载,当然你可以使用web服务自己搭建可以用于下载的资源服务器,如nginx,这里我们主要介绍django中的文件下载. 我们这里 ...

  4. MFC CAD控制权问题

    begineditorcommand(); 隐藏对话框  把控制权交给CAD completeeditorcommand(); 完成交互返回到应用程序 canceleditorcommand CAD被 ...

  5. vue刷新本页面

    顶层app.vue页面 <template> <div id="app"> <router-view v-if="isRouterAlive ...

  6. jq购物车结算功能

    css *{font-style: normal} .gw{margin: 8px;} .gw::after{display: block;clear: both;content: '';margin ...

  7. jquery操作元素之间相邻的元素的获取方式

    <!DOCTYPE html><html> <head> <style> .siblings * { display: block; border: 2 ...

  8. 计蒜客 成绩统计 (Hash表)

    链接 : Here! 思路 : 如果用 $STL$ 的 $map$ 或者是使用 $unordered\underline{}map$ 的话是会 $T$ 的, 所以得手写一个 $hash表$. 其实这个 ...

  9. codevs1961 躲避大龙

    1961 躲避大龙  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 钻石 Diamond 题解       题目描述 Description 你早上起来,慢悠悠地来到学校门口, ...

  10. C语言实现截屏

    实现手机控制电脑执行部分功能需要获取桌面状态,在网上找的一段截屏代码 /** * GDI 截屏函数 * 参数 hwnd 要截屏的窗口句柄 * 参数 dirPath 截图存放目录 * 参数 filena ...