简体   繁体   English

如何在 Heroku 上部署 SpringBoot 项目?

[英]How to deploy SpringBoot project on Heroku?

My SpringBoot project consists of several modules.我的 SpringBoot 项目由几个模块组成。 This is an example project structure:这是一个示例项目结构:

---Application(packaging pom)
--------Main A(packaging jar)   
--------Module B(packaging jar)
--------Module C(packaging jar)
   pom.xml

Module A is the main.模块A是主要的。 It has only one class that runs the project(SpringBootApplication).它只有一个运行项目的类(SpringBootApplication)。 Other modules just use each other's dependencies.The module A uses the dependencies of all other modules.其他模块只是使用彼此的依赖关系。模块 A 使用所有其他模块的依赖关系。

How can I set up the project correctly so that I can deploy to Heroku if the SpringBootApplication in the Module A?如果模块 A 中的 SpringBootApplication,我如何正确设置项目以便我可以部署到 Heroku?

您可以通过运行将 Maven 项目(即子模块)设置为 Maven 选项:

$ heroku config:set MAVEN_CUSTOM_OPTS="-pl Main"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM