首页 > 解决方案 > 如何使用 maven 打包没有主类的自定义 spring-boot 启动器

问题描述

我创建了一个自定义的 spring-boot 启动项目,并希望将其部署到远程 maven 存储库。当我运行时mvn clean package deploy,我收到一条错误消息:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.2.RELEASE:repackage (repackage) on project jcr-service-spring-boot-starter: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.2.RELEASE:repackage failed: Unable to find main class -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

事实上,我认为 spring-boot 启动项目没有必要有一个主类,因为它永远不会单独运行。

大家可以帮忙解释一下我如何打包这个项目吗?

标签: springmavenspring-bootspring-boot-starter

解决方案


推荐阅读