[BUILD] Improve error message when bundled Maven wrapper fails#3566
Closed
hcavarsan wants to merge 2 commits intoapache:mainfrom
Closed
[BUILD] Improve error message when bundled Maven wrapper fails#3566hcavarsan wants to merge 2 commits intoapache:mainfrom
hcavarsan wants to merge 2 commits intoapache:mainfrom
Conversation
pauloborchardt
approved these changes
Dec 15, 2025
pan3793
reviewed
Dec 16, 2025
| echo -e "Warning: Maven '$MVN' not working, trying system 'mvn'..." | ||
| if [ `command -v mvn` ] && mvn --version &>/dev/null; then | ||
| MVN="mvn" | ||
| echo "Using system Maven: $MVN" |
Member
There was a problem hiding this comment.
fast-fail is an expected behavior, it's a dangerous fallback to system mvn without version checking.
you can use the system mvn by passing --mvn /path/of/mvn explicitly
Author
There was a problem hiding this comment.
@pan3793 got it, makes sense. but the thing is… now when the bundled maven fails it just exits without any helpful message, so users don't know what to do. maybe just improving the error output would work?
if ! "$MVN" --version &>/dev/null; then
echo -e "Could not execute Maven command: '$MVN'."
echo " Use --mvn /path/to/mvn to specify an alternate Maven."
exit -1;
fi|
This PR is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This issue was closed because it has been staled for 10 days with no activity. |
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.

What changes were proposed in this pull request?
Update
build/make-distribution.shto provide a error message when the bundled Maven wrapper (build/mvn) is not working, guiding users to specify an alternate Maven.Why are the changes needed?
The bundled Maven wrapper can fail silently or produce unusable output, causing build failures like:

When the bundled Maven doesn't work correctly, the script fails without any helpful message, leaving users unsure how to proceed. This change adds a
--versioncheck with actionable error output:--mvn /path/to/mvnDoes this PR introduce any user-facing change?
No functional change. Error messaging is improved when Maven validation fails.
How was this patch tested?
Tested build script with broken bundled Maven, just confirm error message is displayed with instructions to specify alternate Maven path.