You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Brian St.Clair (JIRA)" <ji...@apache.org> on 2015/05/14 16:54:00 UTC
[jira] [Commented] (MNG-5824) Support MAVEN_ARGS environment
variable as a way of supplying default command line arguments
[ https://issues.apache.org/jira/browse/MNG-5824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14543758#comment-14543758 ]
Brian St.Clair commented on MNG-5824:
-------------------------------------
Here is how it could work:
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index 902de4a..7f3eefe 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -31,6 +31,8 @@
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+# MAVEN_ARGS - parameters passed to Maven. Useful for settings defaults
+# e.g. MAVEN_ARGS="--settings $HOME/settings.xml"
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
@@ -221,7 +223,7 @@ MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
-MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $MAVEN_ARGS $@"
export MAVEN_CMD_LINE_ARGS
exec "$JAVACMD" \
@@ -229,4 +231,4 @@ exec "$JAVACMD" \
-classpath "${M2_HOME}"/boot/plexus-classworlds-*.jar \
"-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${CLASSWORLDS_LAUNCHER} "$@"
+ ${CLASSWORLDS_LAUNCHER} $MAVEN_CMD_LINE_ARGS
> Support MAVEN_ARGS environment variable as a way of supplying default command line arguments
> --------------------------------------------------------------------------------------------
>
> Key: MNG-5824
> URL: https://issues.apache.org/jira/browse/MNG-5824
> Project: Maven
> Issue Type: New Feature
> Components: Command Line
> Affects Versions: 3.3.3
> Reporter: Brian St.Clair
>
> I would like to be able to specify default Maven command line arguments using the MAVEN_ARGS environment variable, similarly to how I can use MAVEN_OPTS to specify default JVM args.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)