exec-maven-plugin icon indicating copy to clipboard operation
exec-maven-plugin copied to clipboard

Fails to launch Windows batch script located in path containing blank

Open mkarg opened this issue 7 years ago • 3 comments

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 that C:\FOO is not found. (Mind the missing rest of the path)

Workaround:

  • Strip path from <executable>
  • Add path to <workingDirectory>

mkarg avatar Oct 17 '17 15:10 mkarg

Surrounding the contents with "" also works, so, for example <executable>"${my program}"</exectuable> also is a workaround.

That said, it's a bad look for Maven to leak OS-dependent problems to users.

TIBCOrkrajews avatar Jul 03 '19 16:07 TIBCOrkrajews

Maven's configuration parameters should always be OS-independent, just as Java's File API is.

mkarg avatar Jul 05 '19 06:07 mkarg

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).

TIBCOrkrajews avatar Jul 08 '19 18:07 TIBCOrkrajews