Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JLINK] Generated PowerShell script does not guard jvm options passed by user on Windows #1088

Open
tvallin opened this issue Nov 21, 2024 · 1 comment
Assignees

Comments

@tvallin
Copy link
Member

tvallin commented Nov 21, 2024

Problem description

There are two issues:

  1. The JVM option passed to *\start.ps1 using the --jvm option are not guarded by ' " ' character.
  2. The default JVM option provided in configuration is not guarded as well.

Reproducer

Using the Helidon application https://github.com/helidon-io/helidon/tree/main/tests/integration/packaging/se-1

  1. Exposes the issue by providing -Dapp.static.path=../../web
mvn -Pjlink-image verify
.\target\helidon-tests-integration-packaging-se-1-jri\bin\start.ps1 --jvm "-Dapp.static.path=../../web"

The workaround is to use this command:

.\target\helidon-tests-integration-packaging-se-1-jri\bin\start.ps1 --jvm "`"-Dapp.static.path=../../web`""

Question is: Should we keep this behavior ?

  1. Exposes this issue by providing app.static.path option through configuration.
mvn -Pjlink-image verify
.\target\helidon-tests-integration-packaging-se-1-jri\bin\start.ps1
@tvallin tvallin self-assigned this Nov 21, 2024
@romain-grecourt
Copy link
Contributor

You are running these command in powershell, so the outer quotes might be interpreted by your shell.

The backtick character is an escape similar to \, so if you do

"`"-Dfoo.bar`""

It's equivalent to this java code:

"\"-Dfoo.bar\""

Have you tried with single quotes instead of double quotes ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants