Skip to content
Snippets Groups Projects
README.md 17.36 KiB

GitLab CI template for Maven

This project implements a generic GitLab CI template for Maven.

It provides several features, usable in different modes (by configuration).

Usage

In order to include this template in your project, add the following to your gitlab-ci.yml:

include:
  - project: 'Orange-OpenSource/tbc/maven'
    ref: '1.1.0'
    file: '/templates/gitlab-ci-maven.yml'

Global configuration

The Maven template uses some global configuration used throughout all jobs.

Name description default value
MAVEN_IMAGE The Docker image used to run Maven maven:latest
MAVEN_CFG_DIR The Maven configuration directory .m2
MAVEN_OPTS Global Maven options -Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=${MAVEN_CFG_DIR}/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true
MAVEN_CLI_OPTS Additional Maven options used on the command line --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true -s ${MAVEN_CFG_DIR}/settings.xml

As you can see, your local Maven settings file is supposed to be located in ${MAVEN_CFG_DIR}/settings.xml.