exec-maven-plugin
exec-maven-plugin copied to clipboard
Fails to launch Windows batch script located in path containing blank
Steps to reproduce:
-
<executable>C:\FOO BAR\My.bat</executable>
(Mind the blank between FOO and BAR)
Expected result:
- Executes
cmd.exe /c "C:\FOO BAR\My.bat"
Actual result:
- Logs that it would execute
cmd.exe /c "C:\FOO BAR\My.bat"
but then fails with error message telling thatC:\FOO
is not found. (Mind the missing rest of the path)
Workaround:
- Strip path from
<executable>
- Add path to
<workingDirectory>
Surrounding the <executable>"${my program}"</exectuable>
also is a workaround.
That said, it's a bad look for Maven to leak OS-dependent problems to users.
Maven's configuration parameters should always be OS-independent, just as Java's File API is.
I’m sorry, the <executable>"${my.program}"</executable>
workaround doesn’t work on Unix because the plugin interprets the double quotes literally (as it well should in all OSes).