You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Sebastian Stenzel (Jira)" <ji...@apache.org> on 2022/10/21 15:14:00 UTC
[jira] [Commented] (MJLINK-64) Add-options double quoting
[ https://issues.apache.org/jira/browse/MJLINK-64?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17622320#comment-17622320 ]
Sebastian Stenzel commented on MJLINK-64:
-----------------------------------------
Not sure if this is related, but the very example that is given for in the docs does not work:
{code:xml}
<addOptions>
<addOption>-Xmx256m</addOption>
<addOption>--enable-preview</addOption>
<addOption>-Dvar=value</addOption>
</addOptions>
{code}
results in:
{noformat}
bin/java -version
Invalid maximum heap size: -Xmx256m --enable-preview -Dvar=value
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
{noformat}
> Add-options double quoting
> --------------------------
>
> Key: MJLINK-64
> URL: https://issues.apache.org/jira/browse/MJLINK-64
> Project: Maven JLink Plugin
> Issue Type: Bug
> Affects Versions: 3.1.0
> Reporter: Tigran Sargsyan
> Priority: Major
>
> In case of add multiple options via *<addOptions>*, they are combined to one in runtime. For example :
>
> {code:java}
> <addOptions>
> <addOption>-Darg1=value1</addOption>
> <addOption>-Darg2=value2</addOption>
> </addOptions>
> {code}
>
>
> In runtime for the following code:
>
> {code:java}
> System.out.println(System.getProperty("arg1"));
> System.out.println(System.getProperty("arg2"));
>
> {code}
> Output is:
>
> {code:java}
> value1 -Darg2=value2
> null
> {code}
>
>
> After I examined the source code, I noticed that in fact, in the final command, it turns out something like '*"-Darg1 = value1 -Darg2 = value2"'* instead of *"-Darg1 = value1 -Darg2 = value2"*.
> I.e +double quoting.+
> _*My seggesion:*_
> Remove reduntant quoting in file *JlinkMojo(line:657).*
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)