From 6257b3314282f795ded9366a52eae627a4206395 Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Mon, 20 Dec 2021 21:53:45 +0100 Subject: [PATCH] [MNG-7193] Introduce MAVEN_ARGS environment variable Add args directly after the class name and leave users the option to override with maven.config or CLI args. This closes #637 --- apache-maven/src/assembly/shared/run | 1 + apache-maven/src/assembly/shared/run.cmd | 1 + apache-maven/src/assembly/shared/validate | 1 + apache-maven/src/assembly/shared/validate.cmd | 1 + 4 files changed, 4 insertions(+) diff --git a/apache-maven/src/assembly/shared/run b/apache-maven/src/assembly/shared/run index b89ecc7d24a7..28814a81786f 100755 --- a/apache-maven/src/assembly/shared/run +++ b/apache-maven/src/assembly/shared/run @@ -17,4 +17,5 @@ exec "$JAVACMD" \ "-Dlibrary.jansi.path=${MAVEN_HOME}/lib/jansi-native" \ "-Dmaven.multiModuleProjectDirectory=$MAVEN_PROJECTBASEDIR" \ $LAUNCHER_CLASS \ + $MAVEN_ARGS \ "$@" diff --git a/apache-maven/src/assembly/shared/run.cmd b/apache-maven/src/assembly/shared/run.cmd index ab6da36667d6..71a9c05e3bd6 100755 --- a/apache-maven/src/assembly/shared/run.cmd +++ b/apache-maven/src/assembly/shared/run.cmd @@ -8,6 +8,7 @@ "-Dlibrary.jansi.path=%MAVEN_HOME%\lib\jansi-native" ^ "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ %LAUNCHER_CLASS% ^ + %MAVEN_ARGS% ^ %* if ERRORLEVEL 1 goto error goto end diff --git a/apache-maven/src/assembly/shared/validate b/apache-maven/src/assembly/shared/validate index 0d22a8b21a86..449e23b24c4d 100644 --- a/apache-maven/src/assembly/shared/validate +++ b/apache-maven/src/assembly/shared/validate @@ -23,6 +23,7 @@ # Environment Variable Prerequisites # # JAVA_HOME (Optional) Points to a Java installation. +# MAVEN_ARGS (Optional) Arguments passed to Maven before CLI arguments. # MAVEN_OPTS (Optional) Java runtime options used when Maven is executed. # MAVEN_SKIP_RC (Optional) Flag to disable loading of mavenrc files. # ----------------------------------------------------------------------------- diff --git a/apache-maven/src/assembly/shared/validate.cmd b/apache-maven/src/assembly/shared/validate.cmd index dc68027bfecd..7920741c6ccd 100644 --- a/apache-maven/src/assembly/shared/validate.cmd +++ b/apache-maven/src/assembly/shared/validate.cmd @@ -21,6 +21,7 @@ @REM Environment Variable Prerequisites @REM @REM JAVA_HOME (Optional) Points to a Java installation. +@REM MAVEN_ARGS (Optional) Arguments passed to Maven before CLI arguments. @REM MAVEN_BATCH_ECHO (Optional) Set to 'on' to enable the echoing of the batch commands. @REM MAVEN_BATCH_PAUSE (Optional) set to 'on' to wait for a key stroke before ending. @REM MAVEN_OPTS (Optional) Java runtime options used when Maven is executed.