From 2be56aa72f08a0f6a2cf483cc9b96cbf23104fd4 Mon Sep 17 00:00:00 2001
From: Timothy Stone <gitlab@petmystone.com>
Date: Thu, 6 Oct 2022 16:48:36 +0000
Subject: [PATCH] fix(maven): use Maven CLI options

---
 README.md                     | 4 ++--
 kicker.json                   | 4 ++--
 templates/gitlab-ci-maven.yml | 3 +--
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index e0b737f..36e7732 100644
--- a/README.md
+++ b/README.md
@@ -24,8 +24,8 @@ The Maven template uses some global configuration throughout all jobs.
 | `MAVEN_IMAGE`         | The Docker image used to run Maven <br/>:warning: **set the version required by your project** | `maven:latest` |
 | `MAVEN_PROJECT_DIR`   | Maven projet root directory | `.` |
 | `MAVEN_CFG_DIR`       | The Maven configuration directory      | `.m2`             |
-| `MAVEN_OPTS`          | [Global Maven options](http://maven.apache.org/configure.html#maven_opts-environment-variable) | `-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](https://maven.apache.org/ref/3-LATEST/maven-embedder/cli.html) used on the command line | `--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true` |
+| `MAVEN_OPTS`          | [Global Maven options](http://maven.apache.org/configure.html#maven_opts-environment-variable) | `-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=${MAVEN_CFG_DIR}/repository -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true` |
+| `MAVEN_CLI_OPTS`      | Additional [Maven options](https://maven.apache.org/ref/3-LATEST/maven-embedder/cli.html) used on the command line | `--no-transfer-progress --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true` |
 
 ### About `$MAVEN_CFG_DIR`
 
diff --git a/kicker.json b/kicker.json
index f9f8082..3867e81 100644
--- a/kicker.json
+++ b/kicker.json
@@ -24,13 +24,13 @@
     {
       "name": "MAVEN_OPTS",
       "description": "[Global Maven options](http://maven.apache.org/configure.html#maven_opts-environment-variable)",
-      "default": "-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",
+      "default": "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=${MAVEN_CFG_DIR}/repository -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true",
       "advanced": true
     },
     {
       "name": "MAVEN_CLI_OPTS",
       "description": "Additional [Maven options](https://maven.apache.org/ref/3-LATEST/maven-embedder/cli.html) used on the command line",
-      "default": "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true",
+      "default": "--no-transfer-progress --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true",
       "advanced": true
     },
     {
diff --git a/templates/gitlab-ci-maven.yml b/templates/gitlab-ci-maven.yml
index 5303c98..2ec89fc 100644
--- a/templates/gitlab-ci-maven.yml
+++ b/templates/gitlab-ci-maven.yml
@@ -58,12 +58,10 @@ variables:
   # default configuration directory
   MAVEN_CFG_DIR: ".m2"
 
-  # This will suppress 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=${MAVEN_CFG_DIR}/repository
-    -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN
     -Dorg.slf4j.simpleLogger.showDateTime=true
     -Djava.awt.headless=true
 
@@ -71,6 +69,7 @@ variables:
   # when running from the command line.
   # `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
   MAVEN_CLI_OPTS: >-
+    --no-transfer-progress
     --batch-mode
     --errors
     --fail-at-end
-- 
GitLab