I want to use the exec:java plugin to invoke the main class from command line. I can pass arguments from the command line using -Dexec.args=\"arg0 arg1 arg2\",
-Dexec.args=\"arg0 arg1 arg2\"
There is no way to set the parameter on the command line.
However, since exec:java is not forked, you can just pass a system property to maven and it will be picked up by exec:java as well.
exec:java
mvn -Dkey=value exec:java -Dexec.mainClass=com.yourcompany.yourclass \ -Dexec.args="arg1 arg2 arg3"