4

I have one repository in GitLab which contains multiple maven projects in different subfolders. For example, let us say it is:

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

I have two questions here:

  1. Can I configure .gitlab-ci.yml so it will run mvn install on each of these projects?
  2. Can I configure .gitlab-ci.yml somehow that it will automatically search for pom.xml files within the repo and sequentially run mvn install on all of them?

UPD: I have just started working with GitLab and probably miss some important knowledge. But from what I understand, typically I should have a pom.xml file located in the root of the repository. Otherwise I should use a trick described here: How to run Maven from another directory (without cd to project dir)? But this doesn't answer the question about how to run deployment of multiple projects within one repo, and how to automatically search for this projects (if it is possible at all).

Andremoniy
  • 34,031
  • 20
  • 135
  • 241

1 Answers1

-1

You better create parent pom at root directory and add sub-dir 's pom as project modules.

Hlex
  • 833
  • 8
  • 16