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 方法 分别在红框的两个类中 删除 或者注释一个就可以

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值