您的位置:首页 > 编程语言 > Java开发

Springboot repackage failed: Unable to find a single main class from the following candidates

2017-07-24 00:00 721 查看
repackage failed: Unable to find a single main class from the following candidates

解决:

情况1:

在pom.xml文件中加入主类,用于指定加载的主类(在properties中,加入一个start-class的属性,用于告诉spring boot maven plugin哪个类是入口类即可)

<properties>
<start-class>com.itmuch.cloud.common.Application</start-class>
</properties>


情况2:

多模块依赖时,如果类似common之类的module只作为依赖包,而无需作为springboot的application时,以下打包插件不应配置到顶级pom及common的pom中:

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

具体哪个module需要作为application则配到哪个module中则可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐