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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.1
    • 3.5.0-alpha-1, 3.5.0
    • None
    • None
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment