Commit 8a0408fd authored by Matthieu Moy's avatar Matthieu Moy

Maven.gitlab-ci: specify absolute path to .m2/

The existing code is working, but breaks as soon as mvn is run from a
directory other than the root, e.g.

    - cd subdir && mvn test

To be candidate for caching, .m2 must be within the project directory,
but we can specify its absolute location using $CI_PROJECT_DIR/.m2/.
It still works in the base case, and also works in the "cd subdir"
case above hence won't create surprise when users try to adapt the
template to their needs.
parent f160404a
......@@ -17,7 +17,7 @@
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment