[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
This commit is contained in:
Henning P. Schmiedehausen 2022-07-29 06:23:44 +02:00 committed by Michael Osipov
parent 73360100ca
commit 29c53d6748
5 changed files with 7 additions and 2 deletions

View File

@ -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} "$@"

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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.
# -----------------------------------------------------------------------------