We use gitlab ci with shared runners to do our continuous integration. For each build, the runner downloads tons of maven artifacts.
Is there a way to configure gitl
There is another approach. Do not use gitlab cache and use custom (per project) docker image.
Some details:
First of all, you need to create a maven docker image where all (or most of) required for your project dependencies are presented. Publish it to your registry (gitlab has one) and use it for any job running maven.
To create such an image I usually create an additional job in CI triggered manually. You need to trigger it at initial stage and when project dependencies are heavily modified.
Working sample can be found here:
https://gitlab.com/alexej.vlasov/syncer/blob/master/.gitlab-ci.yml - this project is using the prepared image and also it has a job to prepare this image.
https://gitlab.com/alexej.vlasov/maven/blob/master/Dockerfile - dockerfile to run maven and download dependencies once.
The pros: