Skip to content

[MNG-7541] Add Maven 4 PowerShell launcher - #12541

Open
wilx wants to merge 15 commits into
apache:masterfrom
wilx:mng-7541-powershell-4x
Open

[MNG-7541] Add Maven 4 PowerShell launcher#12541
wilx wants to merge 15 commits into
apache:masterfrom
wilx:mng-7541-powershell-4x

Conversation

@wilx

@wilx wilx commented Jul 25, 2026

Copy link
Copy Markdown

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:

  • PowerShell launcher harness passed against the assembled distribution on
    Java 17 and Java 21.
  • The Maven reactor and distribution package build passed.
  • Core ITs: 1,044/1,046 passed; two unrelated tests could not resolve the
    unstaged maven-testing:4.1.0-SNAPSHOT fixture.

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 verify passes 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
    .

@wilx
wilx marked this pull request as ready for review July 25, 2026 23:26

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-MavenOptionString is 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) and powershell (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

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.

[MNG-7541] Native support for PowerShell to start Maven

3 participants