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,这样一套流程.于是 ...
随机推荐
- Maven学习总结(17)——深入理解maven灵活的构建
一个优秀的构建系统必须足够灵活,应该能够让项目在不同的环境下都能成功构建.maven为了支持构建的灵活性,内置了三大特性,即:属性.profile和资源过滤. 1.maven属性 maven属性分6类 ...
- Mosquito的优化——订阅树优化(八)
本文由逍遥子撰写.转发请标注原址: http://blog.csdn.net/houjixin/article/details/46413783 或 http://houjixin.blog.163. ...
- 内存问题检查利器——Purify
内存问题检查利器——Purify 一. 引言 我们都知道软件的测试(在以产品为主的软件公司中叫做QA—Quality Assessment)占了整个软件工程的30% -50%,但有 ...
- css3-12 transition+css或transform实现过渡动画
css3-12 transition+css或transform实现过渡动画 一.总结 一句话总结:首先要设置hover后的效果,然后在transition里面指定执行哪些样式和执行时间为多长. 1. ...
- embed-it_Integrator memory compile工具使用之一
embed-it_Integrator memory compile工具使用之一 主要内容 使用Integrator compile memory 使用Integrator 对比筛选适合的memory ...
- irms模拟数据生成及数据分析 分类: H_HISTORY 2015-03-06 14:17 212人阅读 评论(0) 收藏
一.数据准备 1.每天生成随机一个文本,每小时向文本中追加2次数据,每次10万条 随机数据生成: 2,32 * * * * bash /mnt/jediael/irms/signalGenerat ...
- PatentTips - High-performance AHCI Interface
BACKGROUND OF THE INVENTION Various storage protocols for communicating with storage devices are kno ...
- 使用perl读取Excel
使用perl读取Excel 环境 windows 7 ActiveState Perl Win32::OLE[perl package] 基本功能 循环处理多个sheet 读取Excel单元,提取in ...
- 怎样推断DIV中的内容为空
怎样推断DIV中的内容为空 1.问题背景 推断div内部是否为空.假设为空,给出无数据提示:否则显示正常页面 2.设计源代码 <!DOCTYPE html PUBLIC "-//W3C ...
- spring mvc 解决csrf跨站请求攻击
http://www.dewen.net.cn/q/935/spring+mvc+%E8%A7%A3%E5%86%B3csrf%E8%B7%A8%E7%AB%99%E8%AF%B7%E6%B1%82% ...