[ 
https://jira.codehaus.org/browse/MEXEC-100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=278101#comment-278101
 ] 

Gili commented on MEXEC-100:
----------------------------

> both will result in an invalid command

My mistake. The example code I provided had a bug. The last argument is 
supposed to read:

{code}
<argument>MyPath="${project.build.directory}/Name With Spaces.exe"</argument>
{code}

This results in this output:

{code}
"MyPath="C:\Users\g.tzabari\Documents\vitex\installer\windows\target/Name With 
Spaces.exe""
{code}

In this case, the user is providing a legal command but the plugin is causing 
it to fail. The command-line will interpret the above as:

MyPath=
C:\Users\g.tzabari\Documents\vitex\installer\windows\target/Name
With
Spaces
""

> Plugin breaks arguments containing quotes
> -----------------------------------------
>
>                 Key: MEXEC-100
>                 URL: https://jira.codehaus.org/browse/MEXEC-100
>             Project: Maven 2.x Exec Plugin
>          Issue Type: Bug
>          Components: exec
>    Affects Versions: 1.2
>            Reporter: Gili
>            Priority: Minor
>
> This issue is an extension of MEXEC-81.
> The plugin does a good job quoting arguments automatically, but if a user is 
> not aware of auto-quoting and insists on quoting paths themselves "bad things 
> happen". Given:
> {code}
>                       <plugin>
>                               <groupId>org.codehaus.mojo</groupId>
>                               <artifactId>exec-maven-plugin</artifactId>
>                               <version>1.2</version>
>                               <executions>
>                                       <execution>
>                                               <goals>
>                                                       <goal>exec</goal>
>                                               </goals>
>                                               <phase>process-resources</phase>
>                                               <configuration>
>                                                       
> <executable>cmd.exe</executable>
>                                                       
> <workingDirectory>${project.build.directory}/nsis/${vitex.classifier}</workingDirectory>
>                                                       <arguments>
>                                                               
> <argument>/c</argument>
>                                                               
> <argument>echo</argument>
>                                                               
> <argument>MyPath="${project.build.directory}/Name With Spaces.exe</argument>
>                                                       </arguments>
>                                               </configuration>
>                                       </execution>
>                               </executions>
>                       </plugin>
> {code}
> The plugin will transform the last argument into:
>   MyPath="C:\Users\g.tzabari\Documents\vitex\installer\windows\target/Name 
> With Spaces.exe
> notice the lack of a closing quote. Here is the output I get from echo:
>   "MyPath="C:\Users\g.tzabari\Documents\vitex\installer\windows\target/Name 
> With Spaces.exe"
> Expected behavior: If an argument contains quotes, do not attempt to 
> auto-quote it. Respect the quotes provided by the user.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to