[ 
http://jira.codehaus.org/browse/MNG-2190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_108054
 ] 

Heinrich Nirschl commented on MNG-2190:
---------------------------------------

The approach taken in maven 2.0.7 still does not work as this example shows 
(with bash on Linux):

$ mvn help:effective-settings -Dfoo="ba\" bu"
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'help'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task 'bu': 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: Sun Sep 23 08:47:21 CEST 2007
[INFO] Final Memory: 1M/66M
[INFO] ------------------------------------------------------------------------

I think it's the responsibility of the shell wrapper to correctly pass the 
parameters to the java process. Workarounds in Java are just a mess.

> -Dkey=value parameters cannot include spaces in the value
> ---------------------------------------------------------
>
>                 Key: MNG-2190
>                 URL: http://jira.codehaus.org/browse/MNG-2190
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 2.0.2
>         Environment: Darwin
>            Reporter: Gordon Henriksen
>            Assignee: Brett Porter
>             Fix For: 2.0.x
>
>         Attachments: MNG-2190.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to