[MNG-7541] Add Maven 4 PowerShell launcher - #12541
Open
wilx wants to merge 15 commits into
Open
Conversation
Add cross-platform PowerShell entry points with Maven 4 launcher parity, argument-safe configuration handling, wrapper modes, packaged-launcher tests, and CI coverage for PowerShell 7 and Windows PowerShell 5.1.
wilx
marked this pull request as ready for review
July 25, 2026 23:26
gnodet
approved these changes
Jul 26, 2026
gnodet
left a comment
Contributor
There was a problem hiding this comment.
Well-crafted PowerShell launcher that correctly mirrors the bash/cmd launcher behavior. The complete set of wrappers (mvn.ps1, mvnDebug.ps1, mvnenc.ps1, mvnsh.ps1, mvnup.ps1, mvnyjp.ps1) properly delegates with the appropriate mode flags, matching the structure of their bash counterparts.
A few minor observations (none blocking):
ConvertFrom-MavenOptionStringis a clean reimplementation of shell-style word splitting with correct quote awareness.- MAVEN_ARGS suppression for non-MavenCling modes (line 317-319) correctly matches both bash and cmd behavior.
- CI integration is well-positioned: tests run after distribution assembly, gated to Java 17, covering both
pwsh(cross-platform) andpowershell(Windows 5.1). - The test harness avoids a Pester dependency with custom assertions — pragmatic choice for CI portability. Coverage is thorough: syntax validation, exit code propagation, quoted option preservation, POM selection, project base directory discovery, debug/specialized wrapper delegation, RC file loading, and MAVEN_SKIP_RC.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reimplements and completes the PowerShell launcher work originally contributed
by @JurrianFahner in #878, updated for the current Maven 4 launcher. Fixes #8909.
This adds PowerShell equivalents for the Maven launcher and its mode wrappers,
preserves Maven's argument/configuration behavior, packages the scripts, and
tests them with PowerShell 7 and Windows PowerShell 5.1 in CI.
Testing:
Java 17 and Java 21.
unstaged
maven-testing:4.1.0-SNAPSHOTfixture.Following this checklist to help us incorporate your contribution quickly and
easily:
This pull request addresses one issue without pulling in other changes.
The pull request description explains what the change does, how, and why.
The commit has a meaningful subject line and body.
Tests cover the behavioral changes.
mvn verifypasses without exceptions.The Core IT suite passes completely.
I hereby declare this contribution to be licenced under the Apache
License Version 2.0, January
2004.
In any other case, please file an Apache Individual Contributor License
Agreement.