hcavarsan commented on code in PR #3566:
URL: https://github.com/apache/celeborn/pull/3566#discussion_r2623289304


##########
build/make-distribution.sh:
##########
@@ -106,9 +106,16 @@ fi
 
 export MAVEN_OPTS="${MAVEN_OPTS:--Xmx2g -XX:ReservedCodeCacheSize=1g}"
 
-if [ ! "$(command -v "$MVN")" ] ; then
-    echo -e "Could not locate Maven command: '$MVN'."
-    exit -1;
+# Validate Maven - fallback to system mvn if bundled doesn't work
+if ! "$MVN" --version &>/dev/null; then
+    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"

Review 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?
   
   ```bash
   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 is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to