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

-Dkey=value parameters cannot include spaces in the value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 2.0.2
    • None
    • Command Line
    • None
    • Darwin

    Description

      Even if I properly escape spaces in a path at the shell level, Maven seems to re-split the command parameters. For instance, on Unix, the following should all run the compile goal with a property foo="bar baz":

      $ mvn compile "-Dfoo=bar baz"
      $ mvn compile -Dfoo="bar baz"
      $ mvn compile -Dfoo=bar\ baz

      But in fact, Maven fails, complaining that "baz" is an invalid task:

      [INFO] Scanning for projects...
      [INFO] ----------------------------------------------------------------------------
      [ERROR] BUILD FAILURE
      [INFO] ----------------------------------------------------------------------------
      [INFO] Invalid task 'baz': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
      [INFO] ----------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ----------------------------------------------------------------------------
      [INFO] Total time: < 1 second
      [INFO] Finished at: Wed Mar 29 15:21:01 EST 2006
      [INFO] Final Memory: 1M/2M
      [INFO] ----------------------------------------------------------------------------

      Is this intended behavior? Seems as if Maven is unnecessarily splitting the string, when the OS already does as much.

      I was merely trying to run:

      mvn deploy:deploy-file "-Dfile=/Users/me/Desktop/Bellicose SDK/lib/Bellicose.jar" ...

      In my case, it's practical to work around by renaming the Bellicose SDK folder, but it seems as if Windows users stuck with "C:\Documents and Settings\..." might have a harder time of it.

      Attachments

        1. MNG-2190.patch
          7 kB
          Gordon Henriksen

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gordonhenriksen Gordon Henriksen
              Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: