Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5823

mvnDebug doesn't work with M2_HOME with spaces - missing quotes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.1
    • Fix Version/s: 3.5.0-alpha-1, 3.5.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows, Cygwin

      Description

      When calling mvnDebug in a Cygwin shell, I get the following error

      Preparing to Execute Maven in Debug Mode
      dirname: extra operand `Files/Maven/apache-maven-3.3.1/bin/mvnDebug'
      Try `dirname --help' for more information.
      env: /mvn: No such file or directory
      

      The root cause are missing quotes in and around the dirname call. The script currently calls

      env MAVEN_OPTS="$MAVEN_OPTS $MAVEN_DEBUG_OPTS" $(dirname $0)/mvn "$@"
      

      but the call should be

      env MAVEN_OPTS="$MAVEN_OPTS $MAVEN_DEBUG_OPTS" "$(dirname "$0")/mvn" "$@"
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael-o Michael Osipov
                Reporter:
                tobias.oberlies Tobias Oberlies
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: