Skip to content

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Jul 24, 2025

Backport

This will backport the following commits from master to maven-4.0.x:

Questions ?

Please refer to the Backport tool documentation

Fixes apache#10937 by introducing an additional INTERNAL_MAVEN_OPTS for any arguments that need to be inserted by the script. Parsing the externally-defined MAVEN_OPTS variable can lead to incorrect processing of quotes and special characters, so use the separate variable to avoid doing so.

Additionally JVM_CONFIG_MAVEN_OPTS is introduced as its own variable to preserve the append behaviour.

Remove quotes from the new JVM_CONFIG_MAVEN_OPTS to also allow quoted pipes to work from jvm.config
This is a follow-up to apache#10937, where the extra layer of quotes causes parsing issues in Windows cmd

Test that adding pipes to either MAVEN_OPTS or jvm.config does not break anything
Note: it is important that a jvm.config exists for the MAVEN_OPTS portion of the test to work

By default xargs handles quotes specially. To avoid this behaviour, `-0` must be used instead, but first we need to convert LF to NUL.
Since quotes are no longer being stripped by xargs, we should also stop trying to add them back in otherwise nested quotes cause further issues

---------

Co-authored-by: Bob <BobVul@users.noreply.github.com>
(cherry picked from commit aeff353)
@gnodet gnodet added bug Something isn't working backport labels Jul 24, 2025
@gnodet gnodet merged commit 7901fc7 into apache:maven-4.0.x Jul 24, 2025
37 of 38 checks passed
@github-actions github-actions bot added this to the 4.0.0 milestone Jul 24, 2025
@gnodet gnodet deleted the backport/maven-4.0.x/pr-10970 branch September 2, 2025 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants