【问题标题】:Run several maven projects within one repository with GitLab CI使用 GitLab CI 在一个存储库中运行多个 maven 项目
【发布时间】:2018-04-05 13:15:51
【问题描述】:

我在 GitLab 中有一个存储库,其中包含不同子文件夹中的多个 maven 项目。例如,让我们说它是:

/ProjectA/pom.xml
/ProjectB/pom.xml

我有两个问题:

  1. 我能否配置.gitlab-ci.yml,使其在每个项目上运行mvn install
  2. 我能否以某种方式配置 .gitlab-ci.yml,使其自动在 repo 中搜索 pom.xml 文件并在所有文件上依次运行 mvn install

UPD:我刚开始使用 GitLab,可能会错过一些重要知识。但据我了解,通常我应该在存储库的根目录中有一个 pom.xml 文件。否则我应该使用这里描述的技巧:How to run Maven from another directory (without cd to project dir)? 但这并没有回答有关如何在一个 repo 中运行多个项目的部署以及如何自动搜索这些项目(如果可能的话)的问题。

【问题讨论】:

    标签: git maven gitlab gitlab-ci gitlab-ci-runner


    【解决方案1】:

    你最好在根目录创建父 pom 并添加 sub-dir 的 pom 作为项目模块。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-09
      • 1970-01-01
      • 2021-12-29
      • 1970-01-01
      • 2021-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多