You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Marwell (Jira)" <ji...@apache.org> on 2023/01/09 20:23:00 UTC

[jira] [Created] (MWRAPPER-90) Use arrays to preserve potential whitespace in arguments

Benjamin Marwell created MWRAPPER-90:
----------------------------------------

             Summary: Use arrays to preserve potential whitespace in arguments
                 Key: MWRAPPER-90
                 URL: https://issues.apache.org/jira/browse/MWRAPPER-90
             Project: Maven Wrapper
          Issue Type: Improvement
          Components: Maven Wrapper Scripts
            Reporter: Benjamin Marwell


The bash scripts call mvn using:


{code:java}
# shellcheck disable=SC2086 # safe args
exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"{code}
However, this might mangle parameters containing spaces into multiple parameters. It would be only safe when using arrays and use quotes, e.g. {{{}"${MAVEN_OPTS[@]}"{}}}. Same for the others. This would also allow us to disable the shellcheck check.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)