問題如下:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.5.RELEASE:repackage (default) on project information: 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.hhly.InformationApplication, com.hhly.test.Application] -> [Help 1]
解決方法:
這個錯誤是因為Maven在執行打包的時候會查找項目中的main方法,並設置為Spring Boot生成JAR包的啟動入口,但此時有多個main方法,Maven插件就無法確認是用哪個。因此出現此異常。
1、注釋掉其他無用的main方法即可解決此問題。
2、在命令上指定入口:
mvn package -Dstart-class=com.jsoft.MainClass
參考:
http://www.cnblogs.com/xingzc/p/5972488.html