300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > 解决Unable to find a single main class from the following candidates

解决Unable to find a single main class from the following candidates

时间:2020-12-18 05:44:53

相关推荐

解决Unable to find a single main class from the following candidates

SpringBoot打包异常提示:Unable to find a single main class from the following candidates

说明该项目中有很多main方法,需要制定一个main方法的入口。

在maven项目中加上这个,指定入口和启动类型

<build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><!-- 指定该Main Class为全局的唯一入口 --><mainClass>com.bsj.boyun.open.car.BoyunOpenCarApplication</mainClass><layout>ZIP</layout></configuration><executions><execution><goals><goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中--></goals></execution></executions></plugin></plugins></build>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。