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位.
随机推荐
- c#中动态创建textbox并且从数据库中获取表中数据添加到textbox中
private void FormLugOther_Load(object sender, EventArgs e) { foreach (string str in FormLug.FieldLis ...
- 让System.Drawing.Bitmap可以在linux运行
.net core的bitmap使用的是以下类库,但无法在linux运行 https://github.com/CoreCompat/CoreCompat 在linux运行需要安装runtime.li ...
- 如何使用 Python 创建一名可操控的角色玩家
在 这个系列的第一篇文章 中,我解释了如何使用 Python 创建一个简单的基于文本的骰子游戏.在第二部分中,我向你们展示了如何从头开始构建游戏,即从 创建游戏的环境 开始.但是每个游戏都需要一名玩家 ...
- tomcat8安装及配置
首先是解压版的安装.很简单,直接解压到要安装的位置就OK了. 2.启动 bin目录下,执行startup.bat文件 3.浏览器中打开地址http://localhost:8080/
- 安装RHEL7红帽操作系统
1.单击“开启此虚拟机”启动RHEL 7系统安装. 开启虚拟机 2.通过键盘方向键选择Install Red Hat Enterprise Linux 7.0选项,然后回车,开始安装RHEL7操作系统 ...
- 31.IK分词器配置文件讲解以及自定义词库
主要知识点: 知道IK默认的配置文件信息 自定义词库 一.ik配置文件 ik配置文件地址:es/plugins/ik/config目录 IKAnalyzer.cfg.xml:用 ...
- Thesis Viva checklist
This list gives you suggestions helpful in preparing to defend your thesis: I know my thesis thoroug ...
- 7.2.1 代码测试 doctest
Python标准库 doctest 可以搜索程序中类似于交互式Python代码的文本片段,并运行这些交互式代码来验证是否符合预期结果和功能,常用于Python程序的模块测试. 使用doctest模块测 ...
- Django——4 模板标签 模板的继承与引用
Django 模板标签 常用标签 模板的继承与引用 模板标签 标签在渲染的过程中提供任意的逻辑 标签语法: 由%}和 {% 来定义的,例如:{%tag%} {%endtag%} 这个定义是刻意模糊的. ...
- Codeforces Round #404 (Div. 2)——ABCDE
题目这里 A.map裸题 #include <bits/stdc++.h> using namespace std; map <string, int> p; string s ...