Skip to content

Pass a native Windows path in MAVEN_BASEDIR to Maven builds#504

Open
ppkarwasz wants to merge 2 commits into
gha/v0from
fix/windows-maven-basedir
Open

Pass a native Windows path in MAVEN_BASEDIR to Maven builds#504
ppkarwasz wants to merge 2 commits into
gha/v0from
fix/windows-maven-basedir

Conversation

@ppkarwasz

Copy link
Copy Markdown
Member

Sets MAVEN_BASEDIR to ${{ github.workspace }} in build-reusable.yaml, so that Maven receives maven.multiModuleProjectDirectory as a native Windows path.

Motivation

The build runs ./mvnw under shell: bash on all platforms. On Windows runners this means Git Bash (MinGW). Using Maven 3 with this shell, we end up with a mixed Windows path (D:/foo/bar/baz), which triggers issue RAT-559).

The workaround overrides that default value with a Windows path in canonical form.

The workaround can be removed when either RAT-559 or its workaround apache/maven#12537 (backport of the MinGW path conversion to the 3.x line) are published.

Under `shell: bash` on Windows runners, MSYS2 rewrites the POSIX path
computed by `bin/mvn` into the mixed `D:/...` form, which breaks
plugins that handle paths as strings (e.g. Apache RAT 0.17-0.18).
Providing `MAVEN_BASEDIR` short-circuits the computation, so
`maven.multiModuleProjectDirectory` keeps its native form.

Remove when apache/maven#12537 is resolved.

Assisted-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI 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.

Pull request overview

Updates the reusable GitHub Actions build workflow to ensure Maven receives a native Windows workspace path when running under shell: bash on Windows runners, avoiding mixed-path issues that can trigger RAT-559-related failures.

Changes:

  • Set MAVEN_BASEDIR to ${{ github.workspace }} so Maven Wrapper can pass a native Windows path to maven.multiModuleProjectDirectory.
  • Added inline workflow documentation pointing to the upstream Maven context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Assisted-By: Claude Fable 5 <noreply@anthropic.com>
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