wilx opened a new pull request, #441: URL: https://github.com/apache/maven-shared-utils/pull/441
Quote each Windows CMD executable and argument separately, escape embedded double quotes with `^`, and prefix the command with `@` to prevent `cmd /C` from stripping the executable's opening quote. This covers executable paths containing parentheses or CMD metacharacters and applies to spaced PowerShell host paths such as `C:\Program Files\PowerShell\7\pwsh.exe`. Fixes https://github.com/apache/maven-invoker/issues/127 (MSHARED-832). Companion Invoker execution tests: https://github.com/wilx/maven-invoker/tree/issue-127-windows-cmd-path-test. **Draft / upstream overlap:** [517e861](https://github.com/apache/maven-shared-utils/commit/517e861c847ec23fd893795c804012b007342126) has since introduced selective item quoting and shipped in 3.5.0. This branch proposes the alternative unconditional-quoting/`@` approach. It needs reconciliation with that change, including an add/add conflict in `CmdShellTest.java`, before it is ready to merge. Validation on Linux with Java 8: - `mvn -o -B -V clean verify`: 782 tests, 0 failures/errors, 19 skips. - Additional command-rendering checks passed for spaced `pwsh.exe` and `powershell.exe` executable paths, a spaced `.ps1` path, and an argument containing spaces and `&`. - Actual Windows execution was not run locally; rendering checks do not establish end-to-end PowerShell execution. - [x] I hereby declare this contribution to be licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
