【发布时间】:2019-11-24 21:52:21
【问题描述】:
当前设置:
- 马文
- 春季启动
- 角度
- 12个maven项目+1个Pom项目
- 吉特
- 詹金
目前我有单独的 13 个项目。 每次如果我必须在另一台机器上进行设置,那么我必须单独克隆每个项目。 我还为自动构建做了 Jenkins 管道设置。
寻找
- 一旦我克隆了单个 pom/main 项目,所有其他项目都应该被克隆
- 如果我拉取主项目,那么所有其他项目的代码都应该更新
每次我启动 jenkin 时,子项目都应该得到 head revision 构建。
希望为每个子项目保留单独的 repo,以便在其他项目中重复使用,因为我有多个需求。
我想到的解决方案:
- Maven 子项目
- Git 子模块
上述解决方案面临的问题
1. Maven Child projects
--> If we are using maven child projects then we are literally copying the sub projects in pom/main project.
In this case i cannot reuse the project. Every time i have to clone the project to use it.
For big project with number of team member working, merging issue will come.
2. Git Sub modules
--> This is best solution for me but when we create sub module it always point to commit not the head revision.
Every time i have to manually pull the latest code push it to parent project.
This approach we can not use in Jenkins.
是否有可以解决所有问题的最佳方法。
【问题讨论】:
-
我不明白你反对 Maven 多模块方法的任何观点。
-
stackoverflow.com/questions/53456841/… 帖子也对 SO 进行了同样的解释。
标签: java git maven spring-boot jenkins