You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/07/29 18:43:46 UTC

[maven] branch maven-3.9.x updated: [MNG-7193] Introduce MAVEN_ARGS environment variable

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch maven-3.9.x
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/maven-3.9.x by this push:
     new 29c53d674 [MNG-7193] Introduce MAVEN_ARGS environment variable
29c53d674 is described below

commit 29c53d67483445094270740477fa8909b6fd9f85
Author: Henning P. Schmiedehausen <he...@schmiedehausen.org>
AuthorDate: Fri Jul 29 06:23:44 2022 +0200

    [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 #782
---
 apache-maven/src/bin/mvn          | 3 ++-
 apache-maven/src/bin/mvn.cmd      | 3 ++-
 apache-maven/src/bin/mvnDebug     | 1 +
 apache-maven/src/bin/mvnDebug.cmd | 1 +
 apache-maven/src/bin/mvnyjp       | 1 +
 5 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index dfa384b8e..a3004f917 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -23,6 +23,7 @@
 # Environment Variable Prerequisites
 #
 #   JAVA_HOME       Must point at your Java Development Kit 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.
 # -----------------------------------------------------------------------------
@@ -199,4 +200,4 @@ exec "$JAVACMD" \
   "-Dmaven.home=${MAVEN_HOME}" \
   "-Dlibrary.jansi.path=${MAVEN_HOME}/lib/jansi-native" \
   "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
-  ${CLASSWORLDS_LAUNCHER} "$@"
+  ${CLASSWORLDS_LAUNCHER} ${MAVEN_ARGS} "$@"
diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd
index 9fb4a98c7..b14b9c124 100644
--- a/apache-maven/src/bin/mvn.cmd
+++ b/apache-maven/src/bin/mvn.cmd
@@ -21,6 +21,7 @@
 @REM Environment Variable Prerequisites
 @REM
 @REM   JAVA_HOME          Must point at your Java Development Kit 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.
@@ -176,7 +177,7 @@ set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
   "-Dmaven.home=%MAVEN_HOME%" ^
   "-Dlibrary.jansi.path=%MAVEN_HOME%\lib\jansi-native" ^
   "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
-  %CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
+  %CLASSWORLDS_LAUNCHER% %MAVEN_ARGS% %MAVEN_CMD_LINE_ARGS%
 if ERRORLEVEL 1 goto error
 goto end
 
diff --git a/apache-maven/src/bin/mvnDebug b/apache-maven/src/bin/mvnDebug
index 5f6095a98..2d7cafef9 100755
--- a/apache-maven/src/bin/mvnDebug
+++ b/apache-maven/src/bin/mvnDebug
@@ -23,6 +23,7 @@
 # Environment Variable Prerequisites
 #
 #   JAVA_HOME           Must point at your Java Development Kit 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.
 #   MAVEN_DEBUG_ADDRESS (Optional) Set the debug address. Default value is 8000
diff --git a/apache-maven/src/bin/mvnDebug.cmd b/apache-maven/src/bin/mvnDebug.cmd
index 6a327ff55..9777cf952 100644
--- a/apache-maven/src/bin/mvnDebug.cmd
+++ b/apache-maven/src/bin/mvnDebug.cmd
@@ -21,6 +21,7 @@
 @REM Environment Variable Prerequisites
 @REM
 @REM   JAVA_HOME           Must point at your Java Development Kit 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.
diff --git a/apache-maven/src/bin/mvnyjp b/apache-maven/src/bin/mvnyjp
index a35eabf1f..6e21a0ed2 100755
--- a/apache-maven/src/bin/mvnyjp
+++ b/apache-maven/src/bin/mvnyjp
@@ -23,6 +23,7 @@
 # Environment Variable Prerequisites
 #
 #   JAVA_HOME       Must point at your Java Development Kit 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.
 # -----------------------------------------------------------------------------