springCloud多模块打包时报错问题
执行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多模块打包时报错问题的更多相关文章
- maven:打包时报错,报’找不到符号’
参考文章:https://www.cnblogs.com/kelly-one/p/7349930.html 问题描述: 工程开发调试都没有问题,就是不能导出WAR包,用mvn clean packag ...
- ionic2 打包时报错 file-opener2
在app自动更新过程中,有用到ionic-native插件:cordova-plugin-file-openner2 添加插件后,打包时有错: FAILURE: Build failed wit ...
- 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 ...
- 【maven】在IDEA上 使用maven进行打包时报错:Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:jar
报错内容如下: [INFO] ------------------------------------------------------------------------ [INFO] BUILD ...
- 在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 ...
- maven打包时报错:-source 1.5 中不支持 diamond 运算符
报错现象: 解决方法: 在pom文件中加入下面依赖 <build> <plugins> <plugin> <groupId>org.apache.mav ...
- 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 ...
- springcloud初次zuul超时报错com.netflix.zuul.exception.ZuulException:Forwarding error
报错如下 com.netflix.zuul.exception.ZuulException:Forwarding error Caused by: com.netflix.hystrix.except ...
- iOS之上架打包时报错:ERROR ITMS-90086: "Missing 64-bit support.
根据错误信息在网上基本找到的解决方法是设置targets中build settings中的architectures中的内容 这是因为现在提交的app必须支持64位.
随机推荐
- 用svg做流程管理
说起流程管理这个功能,如果没有个动态图配合显示,简直就是太没有客户体验感了.就比如说请假流程吧,流程走到哪一步了,流程走向过程中都那些人审批的,审批的结果等等,如果就来个列表,也不是说不行,就是觉得太 ...
- [测试工具]----iperf
iperf https://sourceforge.net/projects/iperf/ http://downloads.es.net/pub/iperf/ https://github.com/ ...
- Luogu P2922 秘密消息
原题 P2922 [USACO08DEC]秘密消息Secret Message 题目描述 Bessie is leading the cows in an attempt to escape! To ...
- MySql 日志查看与设置
错误日志log-errol 开启方式:在my.ini的[mysqld]选项下:添加代码:log-error=E:\log-error.txt 记录内容:主要是记录启动.运行或停止mysqld时出现的致 ...
- MySQL数据库操作(一)
一.数据操作 1.显示数据库 show databases; 2.创建数据库 #utf- create database 数据库名称 default charset utf8 collate utf8 ...
- Redis Expire TTL命令
Redis can be told that a key should only exist for a certain length of time. This is accomplished wi ...
- hdu2001 计算两点间的距离【C++】
计算两点间的距离 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Su ...
- Maven学习总结(27)——Maven自定义打包插件maven-assembly-plugin详解
Assembly插件会生成 "assemblies", 此特性等同于的Maven 1 distribution plug-in..该插件不仅支持创建二进制归档文件,也支持创建源码归 ...
- WPF的TextBox以及PasswordBox显示水印文字
1.TextBox <ControlTemplate x:Key="WaterMarkTextBox" TargetType="{x:Type TextBox}&q ...
- CODEVS1187 Xor最大路径 (Trie树)
由于权值是在边上,所以很容易发现一个性质:d(x,y)=d(x,root) xor d(y,root). 因为有了这个性质,那么就很好做了.对于每一个点统计到root的距离,记为f 数组. 将f数组里 ...