提示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. VC 操作 EXCEL---插入工作表(Insert.Sheet)方法

    看到的资料 http://bbs.csdn.net/topics/198565 自己总结一下 //插入到nIndex工作表之前 void InsertSheet(int nIndex) { sheet ...

  2. vue父子组件使用时遇到的一个问题

    子组件一定要写在父组件之前,例如: //子vue,这里遇到一个坑,那就是子vue一定要写在父vue前面,不然会报错. Vue.component('todo-item', { template: $( ...

  3. JVM垃圾回收(GC)流程

    /* 首先介绍一下JVM中堆内存的组成: JVM堆内存主要由三部分组成: (1)新生代: 伊甸园区,存活区,伸缩区 (2)老年代: 老年区,伸缩区 (3)元空间(永久代): 元空间,伸缩区 注意:JD ...

  4. SVN服务端的版本对比及创建仓库时的注意事项

    SVN是一个开放源代码的版本控制系统,分为客户端和服务端.就windows系统而言,客户端通常使用 TortoiseSVN,下载地址:https://tortoisesvn.net/  ,而服务端通常 ...

  5. jquery easyui combobox设置默认选中第一项

    combobox的内容是从后台获取的json, js截取: var data = $('#id').combobox('getData'); $("#id ").combobox( ...

  6. Delphi 调用SQL Server 2008存储过程

    1.表结构如下(预算数据明细表): CREATE TABLE [dbo].[BA_FeeDetail]( [ID] [int] IDENTITY(1,1) NOT NULL, [FeeDeptID] ...

  7. How to check Ubuntu version

    Below you can find some tips on how to check Ubuntu version you are currently running. The first pla ...

  8. MVC二级联动使用$.getJSON方法

    本篇使用jQuery的$.getJSON()实现二级联动.   □ View Models 1: namespace MvcApplication1.Models 2: { 3: public cla ...

  9. C# 中的动态创建技术

    [转载]原文出处  http://blog.csdn.net/baiyun789/article/details/6156694 第一部分 WinForm控件在窗体中动态居中创建.删除控件及对其赋值 ...

  10. 【JVM】调优笔记3-----JVM参数配置 JDK1.8

    一.关于JVM参数配置,有多种途径. 1.在tomcat中直接配置的 打开tomcat的安装目录, 在bin下修改catalina.bat文件 添加如下: set "JAVA_OPTS=-X ...