Spring Boot 项目中只能有一个main方法

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.5.RELEASE:repackage (default) on project mac_filing: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.3.5.RELEASE:repackage failed: Unable to find a single main class from the following candidates [com.coocaa.rifle.mf.Application, com.coocaa.rifle.mf.interceptor.test] -> [Help 1]

由上可知是两个main方法冲突了,把com.coocaa.rifle.mf.interceptor.test中的main方法删除后,就能够打包了。spring

原来是由于 Spring Boot 项目中只能有一个main方法,否则 spring-boot-maven-plugin 在打包的过程当中会扫描到了多个 main 方法,而后就懵逼不知道用哪一个做为启动方法了。maven

之前总喜欢在 Utils 中写个main方法来调试静态方法,看来之后用完就得随手把它给删除了。spring-boot

相关文章
相关标签/搜索