提示Unable to find a single main class from the following candidates错误的原因是会从所有代码里面扫描包括main方法的类,找到多个类就报错了。

解决办法是在pom.xml指定启动的类:

    <properties>
<start-class>com.corp.MyApplication</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

springboot项目打包提示Unable to find a single main class from the following candidates错误的更多相关文章

  1. Maven使用package打包Spring Boot时出现:Unable to find a single main class from the following candidates的问题解决

    问题如下: [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.5.RELEASE ...

  2. SpringBoot学习之一 Unable to find a single main class from the following candidates

    在启动SpringBoot项目是报错 Unable to find a single main class from the following candidates [boot.myboot.Sam ...

  3. Unable to find a single main class from the following candidates ,显示有两个main class

    由于基础框架是用的网上down的源码,我将项目名字改了,估计没有进行maven clean,本地调试的时候没有问题. 当发布时候,执行maven install 一直提示上述错误. 解决办法:1.ma ...

  4. Unable to find a single main class from the following candidates

    关于start-class,spring boot官方手册是这么说明的: The plugin rewrites your manifest, and in particular it manages ...

  5. SpringBoot 项目打包后获取不到resource下资源的解决

    SpringBoot 项目打包后获取不到resource下资源的解决 在项目中有几个文件需要下载,然后不想暴露真实路径,又没有CDN,便决定使用接口的方式来获取文件.最初的时候使用了传统的方法来获取文 ...

  6. springboot项目打包运行

    在springboot项目打包成jar包时,在cmd中使用java -jar **.jar时,浏览器无法访问. 解决方法:把项目改成war包项目,在pom文件中更改,并打成war包. 使用maven命 ...

  7. SpringBoot 项目打包后运行报 org.apache.ibatis.binding.BindingException

    今天把本地的一个SpringBoot项目打包扔到Linux服务器上,启动执行,接口一访问就报错,但是在本地Eclipse中启动执行不报错,错误如下: org.apache.ibatis.binding ...

  8. SpringBoot项目打包成jar后,启动脚本

    将springboot项目打包成jar后,上传至服务器,每次都需要手敲命令,重新部署项目,可将这些命令写入脚本中,直接运行. 启动脚本(start.sh): CUR_PATH=$(cd "$ ...

  9. 用gradle把springboot项目打包成jar

    ``` 用gradle把springboot项目打包成jar ```### build.gradle 中添加 buildscript { repositories { mavenLocal() mav ...

随机推荐

  1. 【HDU】1693:Eat the Trees【插头DP】

    Eat the Trees Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tot ...

  2. bzoj 2300 动态维护上凸壳(不支持删除)

    新技能GET. 用set保存点,然后只需要找前趋和后继就可以动态维护了. /************************************************************** ...

  3. TYVJ 1463 智商问题 分块

    TYVJ 1463 智商问题 Time Limit: 1.5 Sec  Memory Limit: 512 MB 题目连接 http://www.tyvj.cn/p/1463 背景 各种数据结构帝~ ...

  4. PAT甲级1131. Subway Map

    PAT甲级1131. Subway Map 题意: 在大城市,地铁系统对访客总是看起来很复杂.给你一些感觉,下图显示了北京地铁的地图.现在你应该帮助人们掌握你的电脑技能!鉴于您的用户的起始位置,您的任 ...

  5. 转:Windows中的命令行提示符里的Start命令执行路径包含空格时的问题

    转自:http://www.x2009.net/articles/windows-command-line-prompt-start-path-space.html 当使用Windows 中的命令行提 ...

  6. 不用软件快速拥有几百个QQ群并都是管理员

    不用软件快速拥有几百个QQ群并都是管理员!快速拥有有几十万精准数据库的方法 !和快速收集上亿邮箱的思维方法(附上5种赚钱方法).pdf_免费高速下载|百度云 网盘-分享无限制 http://pan.b ...

  7. C#程序集系列03,引用多个module

    我们经常在项目中引用程序集.通常情况下,一个程序集包含一个module,但一个程序集也可以包含多个module.本篇就来体验:在一个可以被编译成.exe可执行文件的.cs文件中引用多个module. ...

  8. 使用docker exec命令

    这个命令使用exit命令后,不会退出后台,一般使用这个命令,使用方法如下   docker exec -it db3 /bin/sh 或者 docker exec -it d48b21a7e439 / ...

  9. ConcurrentBag扩展 批量加入

    public static void AddRange<T>(this ConcurrentBag<T> @this, IEnumerable<T> toAdd) ...

  10. jQuery插件——可以动态改动颜色的jQueryColor

    1.请选择代码框中所有代码后, 保存为 jquery.color.js /*! * jQuery Color Animations v@VERSION * https://github.com/jqu ...