Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions apache-maven/src/assembly/maven/bin/mvn
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,14 @@ cmd="\"$JAVACMD\" \
\"-Dmaven.mainClass=$MAVEN_MAIN_CLASS\" \
\"-Dlibrary.jline.path=${MAVEN_HOME}/lib/jline-native\" \
\"-Dmaven.multiModuleProjectDirectory=$MAVEN_PROJECTBASEDIR\" \
$LAUNCHER_CLASS \
$MAVEN_ARGS"
$LAUNCHER_CLASS"

if [ -n "$MAVEN_DEBUG_SCRIPT" ]; then
echo "[DEBUG] Launching JVM with command:" >&2
printf '[DEBUG] %s' "$cmd" >&2; printf ' "%s"' "$@" >&2; echo >&2
printf '[DEBUG] %s' "$cmd" >&2; printf ' %s' "$MAVEN_ARGS" >&2; printf ' "%s"' "$@" >&2; echo >&2
fi

# User arguments ("$@") are passed directly to preserve literal values
# like ${...} Maven property placeholders without shell expansion.
# Only the base command uses eval for MAVEN_OPTS word splitting.
eval exec "$cmd" '"$@"'
# User arguments ("$@") and MAVEN_ARGS are passed outside the eval'd string
# to preserve literal values (backslashes, ${...} placeholders) without
# shell re-parsing. Only the base command uses eval for MAVEN_OPTS word splitting.
eval exec "$cmd" '$MAVEN_ARGS' '"$@"'
Loading