# This template uses open-jdk 11 for verifying and deploying images
image:maven:3.8.5-openjdk-11-slim
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
paths:
-.m2/repository
# For merge requests do not `deploy` but only run `verify`.
# See https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
.verify:&verify
stage:test
script:
-'mvn$MAVEN_CLI_OPTSverify'
except:
variables:
-$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Verify merge requests using JDK11
verify:jdk11:
<<:*verify
deploy:jdk11:
stage:deploy
script:
-if [ ! -f settings.xml ];
then echo "CI settings missing\! If deploying to GitLab Maven Repository, please see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html#create-maven-packages-with-gitlab-cicd for instructions.";