[ 
http://jira.codehaus.org/browse/MEXEC-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212376#action_212376
 ] 

Nick Foote commented on MEXEC-70:
---------------------------------

This appears to be because elements in the <arguments> list with the same name 
are concatenated.

For example:

<arguments>
  <{color:red}argument{color}>-classpath</argument>
  <classpath/>
  <{color:red}argument{color}>com.example.Main</argument>
<arguments>

is essentially the same as:

<arguments>
  <{color:red}argument{color}>-classpath com.example.Main</argument>
  <classpath/>
<arguments>

I'm not sure if this is intended functionality but since it breaks the example 
on the Exec website I'd assume not. I'm new to Maven but this concatenation 
does not appear to be coming from the ExecMojo code and I'd guess has something 
to do with the way the pom elements are being parsed before being passed into 
the ExecMojo object.
A workaround appears to utilise the fact that elements in the <arguments> list 
currently DO NOT have to be named <argument>.

For example:

<arguments>
  <{color:red}classpathArg{color}>-classpath</classpathArg>
  <classpath/>
  <{color:red}mainClassArg{color}>com.example.Main</mainClassArg>
  <{color:red}progArg1{color}>113</progArg1>
<arguments>

Produces:
java -classpath {the classpath dependencies here} com.example.Main 113

> The class path string generated using the <classpath> argument is being 
> placed at the end of the generated command string.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MEXEC-70
>                 URL: http://jira.codehaus.org/browse/MEXEC-70
>             Project: Maven 2.x Exec Plugin
>          Issue Type: Bug
>          Components: exec
>    Affects Versions: 1.1.1
>         Environment: Fedora release 11 (Leonidas), 
>            Reporter: James Sofra
>
> When trying to run a java executable the class path string generated using 
> the <classpath> argument is being placed at the end of the generated command 
> string unless it is the very first argument in which case it is places 
> directly after the "java" command.
> For example:
> <configuration>
>     <executable>java</executable>
>     <arguments>
>         <argument>-classpath</argument>
>         <classpath/>
>         <argument>com.example.Main</argument>
>     <arguments>
> </arguments>
> Produces:
> java -classpath com.example.Main {the classpath dependencies here} 

-- 
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

        

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

    http://xircles.codehaus.org/manage_email


Reply via email to