Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.1-beta-2
-
Fix Version/s: 1.0.1
-
Component/s: None
-
Labels:None
-
Environment:Linux (in my case, Mandrake 9.1)
Description
If I want to pass a Java property with a space in it through to my goal,
for example,
maven -e "-Dminestar.release=stable potatoes" zip
maven incorrectly quotes the parameters when passing them to Java resulting in:
BUILD FAILED
Goal "potatoes" does not exist in this project.
HERE'S THE FIX:
Edit the maven shell script. Down the bottom are two lines which say:
$MAIN_CLASS $@
Change them to
$MAIN_CLASS "$@"
This tells the shell to quote parameters individually. The bash manual says:
@ Expands to the positional parameters, starting from one. When
the expansion occurs within double quotes, each parameter
expands to a separate word. That is, "$@" is equivalent to "$1"
"$2" ... When there are no positional parameters, "$@" and $@
expand to nothing (i.e., they are removed).
It took me ages to find this trick for our own system, I know it's confusing as hell.
Applied suggested fix