在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的更多相关文章

  1. 关于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 ...

  2. 【Python】pyinstaller打包运行报错failed to execute script main

    前言 最近用pyinstaller打包的时候一直报"failed to execute script main". 最终使用"pyinstaller --hidden-i ...

  3. 在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 ...

  4. 【解决】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 ...

  5. Pyinstaller 打包exe 报错 "failed to execute script XXX"的一种解决方案

    最近用PyQt5写了一个界面小程序,需要打包成exe给到其他windows上使用,一开始使用python 3.7 64位,用pyinstaller打包exe,在64位机上运行正常. 但是目标电脑是32 ...

  6. 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, ...

  7. 【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 ...

  8. spring boot 启动报错(spring-boot-devtools热部署后):The elements [spring.resources.cache-period] were left unbound. Update your application's configuration

    详细错误代码: *************************** APPLICATION FAILED TO START *************************** Descript ...

  9. Spring boot 启动报错 Failed to auto-configure a DataSource

    1.Spring boot 启动报错 Failed to auto-configure a DataSource 参考资料https://blog.csdn.net/liuyinfei_java/ar ...

随机推荐

  1. Java输出文件到本地(输出流)

    package cn.buaa; import java.io.File; import java.io.FileOutputStream; import java.io.FileWriter; im ...

  2. 2016-2017-2 20155309南皓芯《java程序设计》第七周学习总结

    教材学习内容总结 Lambda 一种匿名方法 表达式构成 括号以及括号里用逗号分隔的参数列表 仅有一个参数的可以省略括号 ->符号 花括号以及花括号里的语句 仅有一条语句时可以省略花括号,并且这 ...

  3. WORDPRESS登录后台半天都无法访问或者是访问慢的解决方法

    wordpress登录后台如果打开速度慢,一般分为两部分,第一部分是php虚拟主机的原因,其中主机的原因,又分为很多种情况.第二部分就是WordPress程序本身的问题.这里无忧主机小编主要是讲第二部 ...

  4. USACO 5.3 Big Barn

    Big BarnA Special Treat Farmer John wants to place a big square barn on his square farm. He hates to ...

  5. pyqt5猜数小程序

    程序界面用qt设计师制作,并用pyuic5命令转换成form.py文件 #-*- coding:utf-8 -*- from PyQt5.QtWidgets import QApplication,Q ...

  6. nodejs 项目,请求返回Invalid Host header问题

    今天在linux上安装node,使用node做一个web服务器,在linux上安装各种依赖以后开始运行但是,出现了:Invalid Host header 的样式,在浏览器调试中发现是node返回的错 ...

  7. 【记录】【持续更新】mybatis使用记录

    1.>  < 等符号在mybatis中的sql语句需要转义 > : > < : < 2.mybatis动态选择 <choose> <when te ...

  8. shell script执行的几种方式

    编写一个shell脚本test.sh,内容如下 a='测试执行方式' echo $a 方式1 使用路径的方式执行 chmod a+x test.sh ./test.sh 执行结果如下 当脚本执行之后, ...

  9. kafka和springboot整合应用

    加载依赖 <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>s ...

  10. Onenet学习笔记

    中国移动物联网开放平台:https://open.iot.10086.cn/ 一.平台概述 简介 OneNET是中国移动物联网有限公司响应“大众创新.万众创业”以及基于开放共赢的理念,面向公共服务自主 ...