Skip to content

[maven-4.0.x] Fix mvn script expanding ${...} in CLI arguments#12095

Open
gnodet wants to merge 2 commits into
maven-4.0.xfrom
backport-11983-to-4.0.x
Open

[maven-4.0.x] Fix mvn script expanding ${...} in CLI arguments#12095
gnodet wants to merge 2 commits into
maven-4.0.xfrom
backport-11983-to-4.0.x

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 19, 2026

Backport of #11983 to maven-4.0.x.

Fixes the mvn shell script incorrectly expanding ${...} placeholders in CLI arguments. Includes an integration test.

Original author: Gerd Aschemann

Claude Code on behalf of Guillaume Nodet

ascheman and others added 2 commits May 19, 2026 12:01
The eval in the mvn script causes shell expansion of ${...} patterns
in user-provided arguments. Pass user arguments directly via "$@"
instead of concatenating them into the eval string. This preserves
MAVEN_OPTS word splitting while preventing unintended shell expansion.

Fixes #11978

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The eval in the mvn script causes shell expansion of ${...} patterns
in user-provided arguments. This regression test exercises the actual
launcher script via setForkJvm(true) and verifies that ${...} is not
expanded by the shell.

Related: #11978

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gnodet gnodet added this to the 4.0.0-rc-6 milestone May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants