【发布时间】:2021-02-28 23:00:17
【问题描述】:
我有一个基于 Springboot 框架构建的系统,它运行两个服务,如图所示:
我需要构建 stock-quote-manager 以将其容器化。 我尝试使用 mvnw 以这种方式构建它:
./mvnw spring-boot:build-image
但它引发了一个错误,让我相信我需要重构整个代码,将 stockquotemanager 或 stockmanager 移动到另一个包。有没有其他方法可以在不进行任何重构的情况下构建它?
这是 mvnw 错误:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.107 s
[INFO] Finished at: 2021-02-28T10:33:14-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.3:repackage (repackage) on project stock-quote-manager: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.4.3:repackage failed: Unable to find a single main class from the following candidates [com.br.inatel.stockmanager.StockManagerApplication, com.br.inatel.stockquotemanager.StockQuoteManagerApplication] -> [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
我不知道这是否相关,但 StockManager 在端口 8080 上运行,stockQuoteManager 在端口 8081 上运行。
提前致谢,
【问题讨论】:
标签: java spring-boot