Spring boot 應用maven 打包 遇到的情況

D:\Work\IdeaProjects\issuance>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building issuance 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ issuance -
--
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 9 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ issuance ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 61 source files to D:\Work\IdeaProjects\issuance\target\classes

[WARNING] /D:/Work/IdeaProjects/issuance/src/main/java/com/highershine/controlle
r/ResultsOfBattleController.java: 某些輸入文件使用了未經檢查或不安全的操作。
[WARNING] /D:/Work/IdeaProjects/issuance/src/main/java/com/highershine/controlle
r/ResultsOfBattleController.java: 有關詳細信息, 請使用 -Xlint:unchecked 重新編譯

[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ is
suance ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Work\IdeaProjects\issuance\src\tes
t\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ issuanc
e ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ issuance ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ issuance ---
[INFO] Building jar: D:\Work\IdeaProjects\issuance\target\issuance-0.0.1-SNAPSHO
T.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:1.4.7.RELEASE:repackage (default) @ issuance
 ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.554 s
[INFO] Finished at: 2017-12-22T09:40:02+08:00
[INFO] Final Memory: 46M/420M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin
:1.4.7.RELEASE:repackage (default) on project issuance: Execution default of goa
l org.springframework.boot:spring-boot-maven-plugin:1.4.7.RELEASE:repackage fail
ed: Unable to find a single main class from the following candidates [com.higher
shine.issuance.IssuanceApplication, com.highershine.service.impl.KeyServiceImpl]
 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutio

nException

原因是 spring boot 應用是用main 方法啓動的 而 這個項目中有兩個main 方法 分別在紅框的兩個類中 刪除 或者註釋一個就可以

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章