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

Paul Cager commented on MNG-3356:
---------------------------------

This error will only affect the *Debian* Maven package, and happens because 
Debian are using commons-cli version 1.1 (rather than version 1.0 which 
standard  Maven uses).

Please see

 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=458895
and
 http://issues.apache.org/jira/browse/CLI-137

for a full description of why this is happening. A revised Debian package is 
being prepared.

In summary:

version 1.1 of commons-cli introduced a more rigid interpretation of the API 
specification for the hasArg() method of OptionBuilder, such that hasArg() 
implies there can only be *one* instance of the argument (I think there is a 
remaining bug in the commons.cli package which I'll take up with them). This 
means that the second "-D" option is taken to be an argument, rather than an 
option. In version 1.0 of commons-cli this restriction was never enforced.

Maven should really be calling the hasArgs() method to indicate there can be 
unlimited "-D" arguments. I've attached the patch Debian is using for this 
problem.

> Multiple -Dkey=value command line options not handled correctly
> ---------------------------------------------------------------
>
>                 Key: MNG-3356
>                 URL: http://jira.codehaus.org/browse/MNG-3356
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 2.0.8
>            Reporter: Christian Koelle
>            Priority: Critical
>
> After upgrading to 2.0.8 on Debian the handling of multiple (more than one) 
> -Dkey=value cli options fail, i.e. something like:
> mvn plugin:goal -Dkey1=value1 -Dkey2=value2
> fails with:
> Invalid task 'key2=value2': you must specify a valid lifecycle phase, or a 
> goal in the format plugin:goal or 
> pluginGroupId:pluginArtifactId:pluginVersion:goal

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