CI Yaml template for Maven
Summary
Yaml template for Maven on gitlab.com offers following lines:
# Cache downloaded dependencies and plugins between builds.
cache:
paths:
- /root/.m2/repository/
This not gonna work, because a folder outside of project can not be cached regarding to .gitlab-ci.yml docs:
cache is used to specify a list of files and directories which should be cached between builds. You can only use paths that are within the project workspace.
Steps to reproduce
- Go to any project on gitlab.com that does not have a .gitlab-ci.yml yet, click on Set up CI button
- A screen with empty .gitlab-ci.yml file is being opened, where you have a dropdown Choose Gitlab CI Yaml template
- Select Maven
- See the mentioned lines 28-30
Expected behavior
Another way to cache maven repository should be proposed in template or just delete the lines what will not work.