This works as expected:
$ mvn -X exec:exec -Dexec.executable=java -Dexec.args="com.example.Main"
...
[DEBUG] Executing command line: [java, com.example.Main]
Caused by: java.lang.ClassNotFoundException: com.example.Main
...
This works as expected as well:
$ mvn -X exec:exec -Dexec.executable=java -Dexec.args="
com.example.Main"
[DEBUG] Executing command line: [java, com.example.Main]
Error: Could not find or load main class com.example.Main
...
As does this:
$ mvn -X exec:exec -Dexec.executable=java -Dexec.args="
com.example.Main"
[DEBUG] Executing command line: [java, com.example.Main]
Error: Could not find or load main class com.example.Main
...
Changing to this (new line after " and spaces before com.example.Main on the next line) causes it to add an additional empty argument to the command line:
$ mvn -X exec:exec -Dexec.executable=java -Dexec.args="
com.example.Main"
...
[DEBUG] Executing command line: [java, , com.example.Main]
Error: Could not find or load main class
...
This repeats with multiple new line / space combinations:
$ mvn -X exec:exec -Dexec.executable=java -Dexec.args="
com.example.Main"
[DEBUG] Executing command line: [java, , , , com.example.Main]
Error: Could not find or load main class
...
It looks to only happen when there's a mix of new lines and spaces.
This works as expected:
This works as expected as well:
As does this:
Changing to this (new line after
"and spaces beforecom.example.Mainon the next line) causes it to add an additional empty argument to the command line:This repeats with multiple new line / space combinations:
It looks to only happen when there's a mix of new lines and spaces.