简体   繁体   English

Spring Heroku 中的引导项目作为对另一个本地 Spring 引导项目的依赖项?

[英]Spring boot project in Heroku as dependency to another local Spring Boot project?

I have a Spring Boot project(say A) that is deployed in Heroku. I am currently creating another Spring Boot project(say L) which is dependent on A. I am creating these as Gradle projects.我有一个部署在 Heroku 中的 Spring 启动项目(比如 A)。我目前正在创建另一个依赖于 A 的 Spring 启动项目(比如 L)。我将这些项目创建为 Gradle 项目。 I see the procedure of making dependency on two projects in Local and those were Maven projects.我在本地看到了依赖两个项目的过程,这些是 Maven 个项目。

I need to place the Gradle link of A project in the Gradle file of L to access all the contents from A in L. Could anyone suggest me the procedure or any websites that I could look for?我需要将 A 项目的 Gradle 链接放在 L 的 Gradle 文件中,以访问 L 中 A 的所有内容。谁能建议我该过程或我可以查找的任何网站?

Project A should be structured in a way that it can publish it's shareable components as a library to a Maven repository such as Central or an internal company repository.项目 A 的结构应该能够将其可共享组件作为库发布到Maven 存储库,例如Central或公司内部存储库。

So project A's directory structure may look like:因此项目 A 的目录结构可能如下所示:

.
├── shareable-logic
└── src
  • src/ is the main Spring Boot application. src/是主要的 Spring 引导应用程序。
  • shareable-logic is a subproject that ispublished . shareable-logic是一个已发布子项目

Then project B simply needs to depend on the published artifact:然后项目 B 只需要依赖已发布的工件:

dependencies {
    implementation("com.example:shareable-logic:1.0.0")
}

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

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