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 the Main-Class and Start-Class entries, so if the defaults don't work you have to configure those there (not in the jar plugin). The Main-Class in the manifest is actually controlled by the layout property of the boot plugin, e.g.
<build>
...
<plugins>
...
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.0.RELEASE</version>
<configuration>
<mainClass>${start-class}</mainClass>
<layout>ZIP</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
...
</build>
所以,当你的默认方式不好用的时候,在properties中,加入一个start-class的属性,用于告诉spring boot maven plugin哪个类是入口类即可。
原文链接:http://www.jianshu.com/p/b521f819b06a
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
Unable to find a single main class from the following candidates的更多相关文章
- springboot项目打包提示Unable to find a single main class from the following candidates错误
提示Unable to find a single main class from the following candidates错误的原因是会从所有代码里面扫描包括main方法的类,找到多个类就报 ...
- 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 ...
- 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 ...
- Unable to find a single main class from the following candidates ,显示有两个main class
由于基础框架是用的网上down的源码,我将项目名字改了,估计没有进行maven clean,本地调试的时候没有问题. 当发布时候,执行maven install 一直提示上述错误. 解决办法:1.ma ...
- Spring Boot Maven Plugin打包异常及三种解决方法:Unable to find main class
[背景]spring-boot项目,打包成可执行jar,项目内有两个带有main方法的类并且都使用了@SpringBootApplication注解(或者另一种情形:你有两个main方法并且所在类都没 ...
- Spring boot 打成jar包问题总结
Spring boot 打成jar包问题总结 1.Unable to find a single main class from the following candidates 1.1.问题描述 m ...
- 修改了SpringBoot的主类名称后,gradle build报错的解决办法
Unable to find a single main class from the following candidates [*.*Application]
- springBoot基础
开始之前最基础的东东here 官网:http://projects.spring.io/spring-boot/ 基础快速构建:http://start.spring.io/ 松哥的博客:http:/ ...
- 搭建Spring Cloud+Dubbo
公司要测试一下zipkin是否可以跟踪全流程,项目的架构比较复杂,不要问我为什么,基本架构如下:前端门户,调用spring cloud组件,spring cloud在调用dubbo,这样一套流程.于是 ...
随机推荐
- cpu信息
在linux系统下能够通过cat /proc/cpuinfo来查看本机上cpu的相关信息,通过processor能够推断逻辑cpu的个数,physical id能够推断物理cpu的个数,通过cpu c ...
- UVA 10603 - Fill BFS~
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&c ...
- Snail—Hibernate之自写固定组件
Hibernate的存储都是在session中进行的,此session非彼session 以下就是从生成的Hibernate配置文件获得连接数据库,然后再得到session等等 package com ...
- js进阶 12-8 如何知道上一个函数的返回值是什么(如何判断上一个函数是否执行成功)
js进阶 12-8 如何知道上一个函数的返回值是什么(如何判断上一个函数是否执行成功) 一.总结 一句话总结:event的result属性即可. 1.event的result属性的实际应用场景是什么? ...
- keil出现蓝色小箭头
- [ES7] Handle Errors in Asynchronous Functions
This lesson shows how regular control flow statements such as try/catch blocks can be used to proper ...
- 第一次使用docker for windows 遇到的坑
原文:第一次使用docker for windows 遇到的坑 1. 目前win10安装docker, 不需要安装其他工具,可直接到官网下载 2. 此版本的docker可同时运行Windows con ...
- [CSS] Build Responsive CSS Layouts with Tachyons
Building responsive css layouts is critical in any modern website. Tachyons makes this easy by desig ...
- 【hdu 5996】dingyeye loves stone
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s) ...
- D3.js以及通用JS(JavaScript)读取并解析server端JSON的注意事项
这个需求事实上挺明白的.可是网上搜出来的教程都乱七八糟,认为实在须要自己总结一下. D3.js眼下已经被广泛使用在数据可视化领域,随着大数据的持续发展,这个框架预计会在今后更加流行(据说其作者Mike ...