Skip to content

Update and clarify the Maven CI template

Timothy Stone requested to merge timothy.stone/gitlab:maven-fixup into master

What does this MR do and why?

  1. Leverage YAML Block with newline chomping, e.g., FOO: >-. Per §8.1.1.2 Block Chomping Indicator of the YAML specification:

    Chomping controls how final line breaks and trailing empty lines are interpreted.

    This makes the MAVEN_OPTS and MAVEN_CLI_OPTS readable and approachable.

  2. Remove the use of -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener in favor of Maven's --no-transfer-progress option. Available since Maven 3.6.

  3. Upgrade the Maven image use Maven 3.8.6 (latest) on Java 8 LTS.

  4. Use extends, a GitLab feature, over YAML Anchors.

  5. Use rules in favor of only and except. Using rules is the preferred GitLab feature.

Screenshots or screen recordings

image

Pipeline from test project is here.

How to set up and validate locally

  1. Copy the contents of the provided Maven.gitlab.yml file.
  2. Paste the contents of the Maven.gitlab.yml file in a new .gitlab-ci.yml
  3. Commit, push, or otherwise execute the pipeline.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Timothy Stone

Merge request reports