原文:Spring Boot Maven Plugin打包异常及三种解决方法:Unable to find main class

背景 spring boot项目,打包成可执行jar,项目内有两个带有main方法的类并且都使用了 SpringBootApplication注解 或者另一种情形:你有两个main方法并且所在类都没有使用 SpringBootApplication注解 ,pom.xml如下 问题 执行mvn clean package,报错如下 说点不相关的,使用install同理。因为spring boot: ...

2017-11-13 20:10 1 147467 推荐指数:

查看详情

maven打包出现unable to find main class问题

搜了好久,有人提到需要spring-boot-maven-plugin这个插件。 添加以后,有的可以了,有的不行。 最后发现是插件必须配置<skip>true</skip>这个节点。 完整来说,就是在pom文件(或者父pom中),有这样一个配置: ...

Wed Aug 05 02:00:00 CST 2020 0 1286
解决SpringBoot项目repackage failed: Unable to find main class Maven打包问题

最近在开发中,遇到这样一个问题,一个通用的工具类项目,在进行打包时,出现repackage failed: Unable to find main class提示找不到主类问题,我就想,我这个项目是一个通用的工具类,不是一个SpringBoot Web工程,我又不需要Main方法的程序启动入口 ...

Wed May 08 20:53:00 CST 2019 0 1250
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM