Gitlab CI – How do I build native Maven dependencies before the current build?
I have the following settings:
- Java Library 1
- Java Library 2
- Java applications
Java
Applications rely on Java Library 1 and Java Library 2, both internal.
You need to install “Java Library 1” and “Java
Library 2″ in the local maven repository to successfully compile and package the “Java Application”.
Java Library
1, Java Library 2, and Java Applications are separate projects on GitLab.
Each project has a .gitlab-ci.yml.
Every “Java library” will have something like this:
build:
script:
- mvn clean install
stage: build
only:
- master
tags:
-.java
I want to tell .gitlab-ci.yml in “Java Applications” to build “Java Library 1” and “Java Library 2” first.
Is this possible?
Solution
I think you’re looking for Multi Project Pipelines .
Multi-project pipeline graphs are useful for larger projects, especially those adopting a microservices architecture, that often have a set of interdependent components which form the complete product.
There is also a discussion of building multiple projects on GitHub: https://gitlab.com/gitlab-org/gitlab-ce/issues/4194