springboot项目打包提示Unable to find a single main class from the following candidates错误分析
哈哈
阅读:345
2021-09-07 17:46:13
评论:0
本文章主要介绍了springboot项目打包提示Unable to find a single main class from the following candidates错误,具有不错的的参考价值,希望对您有所帮助,如解说有误或未考虑完全的地方,请您留言指出,谢谢!
提示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>
声明
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。
发表评论
