arguments="${*:2}"
mvn exec:java -Dexec.mainClass="$1" -Dexec.args="$arguments"
See BashFAQ # 50 for a full explanation. Nonetheless:
"$@" argv - , --foo="$@", set -- hello world, "--foo=hello" "world".
"$*" argv IFS , .
$*, , , glob, , ( ) - , .
arguments="\"${*:2}\"" - "hello world". -Dexec.args=$arguments, ( , glob):
- . , , .
-Dexec.args=$arguments , . - .
-Dexec.args="hello world" - . , , . ,
-Dexec.args="hello , world" .
, -Dexec.args="$arguments" ( , "-Dexec.args=$arguments"). :
- .
$arguments . - .
arguments, , -Dexec.args="hello world" , Maven, . - . , , .
, Maven ( !), , .