maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Cager (JIRA)" <>
Subject [jira] Commented: (MNG-3356) Multiple -Dkey=value command line options not handled correctly
Date Sat, 12 Jan 2008 00:21:57 GMT


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

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:
>             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:
For more information on JIRA, see:


View raw message