Pass a native Windows path in MAVEN_BASEDIR to Maven builds#504
Open
ppkarwasz wants to merge 2 commits into
Open
Pass a native Windows path in MAVEN_BASEDIR to Maven builds#504ppkarwasz wants to merge 2 commits into
ppkarwasz wants to merge 2 commits into
Conversation
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>
Contributor
There was a problem hiding this comment.
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_BASEDIRto${{ github.workspace }}so Maven Wrapper can pass a native Windows path tomaven.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>
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.
Sets
MAVEN_BASEDIRto${{ github.workspace }}inbuild-reusable.yaml, so that Maven receivesmaven.multiModuleProjectDirectoryas a native Windows path.Motivation
The build runs
./mvnwundershell: bashon 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.