mojohaus / appassembler

https://www.mojohaus.org/appassembler/
MIT License
93 stars 49 forks source link

Fix problem with spaces in JAVACMD or CLASSPATH for windows batch scripts #179

Open opax opened 1 year ago

opax commented 1 year ago

This should resolve issue #114 . In addition to the quoted JAVACMD, CLASSPATH is also quoted so that spaces in the classpath do not crash the batch script. The test expectations have been updated accordingly.

aikebah commented 1 year ago

@opax On a quick read I think that your patch will break in case of an unset JAVACMD env variable the case of

https://github.com/mojohaus/appassembler/blob/99cc4e53bacf1256999e50291d16d73c5513587f/appassembler-maven-plugin/src/main/java/org/codehaus/mojo/appassembler/daemon/script/DefaultScriptGenerator.java#L206

As JAVACMD, if unset, is set to JAVA_BINARY in the template. If you then later quote JAVACMD it will look for a binary called "start /min javaw" instead of a binary "start" with arguments "/min" and "javaw"