Uploaded image for project: 'Maven Wrapper'
  1. Maven Wrapper
  2. MWRAPPER-90

Use arrays to preserve potential whitespace in arguments

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Maven Wrapper Scripts
    • None

    Description

      The bash scripts call mvn using:

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

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bmarwell Benjamin Marwell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: