原文:Spring Boot Maven Plugin打包異常及三種解決方法:Unable to find main class

背景 spring boot項目,打包成可執行jar,項目內有兩個帶有main方法的類並且都使用了 SpringBootApplication注解 或者另一種情形:你有兩個main方法並且所在類都沒有使用 SpringBootApplication注解 ,pom.xml如下 問題 執行mvn clean package,報錯如下 說點不相關的,使用install同理。因為spring boot: ...

2019-12-24 18:11 0 1374 推薦指數:

查看詳情

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