【spring cloud】在spring cloud服务中,打包ms-core失败,报错Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.4.RELEASE:repackage (default) on project
在spring cloud服务中,有一个ms-code项目,只为所有的微服务提供核心依赖和工具类,没有业务意义,作为核心依赖使用。所以没有main方法,没有启动类。
在spring cloud整体打包的过程中报错:
[INFO] --- maven-jar-plugin:3.0.:jar (default-jar) @ springcloud-ms-core ---
[INFO] Building jar: D:\document\IdeaProjects\springcloud\springcloud-ms-core\target\springcloud-ms-core-0.0.-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.0..RELEASE:repackage (default) @ springcloud-ms-core ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.425 s
[INFO] Finished at: --07T11::+:
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0..RELEASE:repackage (default) on project springcloud-ms-core: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0..RELEASE:repackage failed: Unable to find main class -> [Help ]
[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 ] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
提示:
错误原因就是没有找到main方法,整个ms-core没有启动入口。
但是它作为核心依赖jar包,又没有参与业务,所以没有给它提供main方法的启动类。
解决方法:
添加一个spring boot的启动类,添加一个main方法作为程序入口。
@SpringBootApplication
public class SpringCloudMsCoreApp {
public static void main(String[] args) {
SpringApplication.run(SpringCloudMsCoreApp.class, args);
}
}
重新打包即可!!!
【spring cloud】在spring cloud服务中,打包ms-core失败,报错Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.4.RELEASE:repackage (default) on project的更多相关文章
- 关于Springboot打包错误的问题 | Failed to execute goal org.springframework.boot:spring-boot-maven-plugin
最近在使用spring-boot整合多模块,但是在父pom中打包maven install时总会报错:Failed to execute goal org.springframework.boot:s ...
- 【Python】pyinstaller打包运行报错failed to execute script main
前言 最近用pyinstaller打包的时候一直报"failed to execute script main". 最终使用"pyinstaller --hidden-i ...
- 在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 ...
- 【解决】MacOS下 Python3.7 使用 pyinstaller 打包后执行报错 Failed to execute script pyi_rth__tkinter
Fix tcl/tk libs inclusion in tkinter with Python3.7 under MacOS 使用 Pyinstaller 打包时候报错 3027 ERROR: Tc ...
- Pyinstaller 打包exe 报错 "failed to execute script XXX"的一种解决方案
最近用PyQt5写了一个界面小程序,需要打包成exe给到其他windows上使用,一开始使用python 3.7 64位,用pyinstaller打包exe,在64位机上运行正常. 但是目标电脑是32 ...
- maven打包 invalid entry size Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.14.RELEASE:repackage (default) on project
打包失败,但是不知是具体是什么引起得,使用mvn -e clean package,定位到报错得代码 在定位到代码,打上断点,使用maven 打包debug模式 找到dubbo.properties, ...
- 【spring cloud】spring cloud打包最外层项目报错:'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging. @ line 9, column 13
OK,spring cloud项目,最外层的父级项目在打包的时候,报错如下: "C:\Program Files\Java\jdk1.8.0_131\bin\java" -Dmav ...
- spring boot 启动报错(spring-boot-devtools热部署后):The elements [spring.resources.cache-period] were left unbound. Update your application's configuration
详细错误代码: *************************** APPLICATION FAILED TO START *************************** Descript ...
- Spring boot 启动报错 Failed to auto-configure a DataSource
1.Spring boot 启动报错 Failed to auto-configure a DataSource 参考资料https://blog.csdn.net/liuyinfei_java/ar ...
随机推荐
- 一步一步学习IdentityServer3 (8)
IdentityServer3结合Hangfire及Cookies中间件实现授权 Idr3数据库Token过期管理 GlobalConfiguration.Configuration.UseSqlSe ...
- hdu 5475 模拟计算器乘除 (2015上海网赛H题 线段树)
给出有多少次操作 和MOD 初始值为1 操作1 y 表示乘上y操作2 y 表示除以第 y次操作乘的那个数 线段树的叶子结点i 表示 第i次操作乘的数 将1替换成y遇到操作2 就把第i个结点的值 替换成 ...
- 【LOJ】#2275. 「JXOI2017」颜色
题解 我们枚举右端点判断合法的左端点有哪些 首先,记录一下右端点右边的点的pre,也就是这个数字前一个出现的位置,取所有小于枚举右端点r的值中最大的一个做为l,用优先队列维护即可,[l + 1,r]就 ...
- USACO 6.5 Closed Fences
Closed Fences A closed fence in the plane is a set of non-crossing, connected line segments with N c ...
- USACO 5.3 Network of Schools
Network of SchoolsIOI '96 Day 1 Problem 3 A number of schools are connected to a computer network. A ...
- USACO 4.2 Job Processing
Job ProcessingIOI'96 A factory is running a production line that requires two operations to be perfo ...
- PHP验证时有用的几段代码
1.htmlspecialchars() htmlspecialchars() 函数把一些预定义的字符转换为 HTML 实体.预定义的字符是: & (和号) 成为 & " ( ...
- Socket 编程之 TCP 实现
前几天介绍了计算机网络的一些概念,并介绍了几个协议.下面就说说 Java 中的 Socket 编程,服务器和客户端是如何通信的呢? 首先要介绍一下 Socket ,我们知道在 TCP/IP 协议簇中, ...
- python 与 mongodb的交互--更新操作
这里只要讨论python与mongod交互的时候insert的问题: from pymongo import * def insert_func(): try: client_obj= MongoCl ...
- Kubernetes(k8s)集群部署(k8s企业级Docker容器集群管理)系列之集群部署环境规划(一)
0.前言 整体架构目录:ASP.NET Core分布式项目实战-目录 k8s架构目录:Kubernetes(k8s)集群部署(k8s企业级Docker容器集群管理)系列目录 一.环境规划 软件 版本 ...