How do you escape spaces or quotes in javapackager's jvmProperties

时间:2017-04-13 14:53:50

标签: exec-maven-plugin javapackager

I'm using exec-maven-plugin to run javapackager from java 8 to bundle a javafx application and the system properties need to contain a space in the value.

When I use <argument>-BjvmProperties=log_path=&quot;%LOCALAPPDATA%/ERMS/Desktop Alerts/&quot I get: Error: Unknown argument: Alerts /

I added a forward slash before the space, which makes javapackager run, but the argument does not seem to be passed correctly when the application runs. In the resulting app/ERMS Desktop Alerts.cfg file it comes out as -Dlog_path=%LOCALAPPDATA%/ERMS/Desktop" Alerts/

If I invoke java from the command line I can use java -Dlog_path="%LOCALAPPDATA%/ERMS/Desktop Alerts" -jar DesktopAlerts.jar and that works fine.

Any (odd) number of slashes I've added has not changed the result at all.

Edit

From javapackager itself run from cmd I have found -BjvmProperties=log_path="${env:LOCALAPPDATA}/ERMS/Desktop Alerts/" works. Now it's a matter of making exec-maven-plugin produce that argument.

1 个答案:

答案 0 :(得分:0)

解决方案是用斜线逃离空间。 <argument>-BjvmProperties=log_path=${env:LOCALAPPDATA}/ERMS/Desktop\ Alerts/</argument>

看来引号是问题 - 可能与https://jira.atlassian.com/browse/BAM-9234

有关