NihalJain commented on code in PR #144:
URL: https://github.com/apache/hbase-thirdparty/pull/144#discussion_r2231835214


##########
dev-support/jenkins/Dockerfile:
##########
@@ -110,14 +112,60 @@ ENV MAVEN_HOME='/opt/maven'
 RUN mv /opt/maven/bin/mvn /opt/maven/bin/mvn-original && \
     cat > /opt/maven/bin/mvn <<'EOF'
 #!/bin/bash
-TOOLCHAIN="${BASEDIR}/dev-support/toolchains-jenkins.xml"
-if [ -f "$TOOLCHAIN" ]; then
+
+echo "Maven wrapper called with args: $@"
+echo "Current working directory: $(pwd)"
+echo "BASEDIR environment variable: ${BASEDIR:-'(not set)'}"
+echo "MAVEN_HOME: ${MAVEN_HOME:-'(not set)'}"
+
+# Ensure Maven home exists
+if [ ! -d "${MAVEN_HOME}" ]; then
+  echo "ERROR: MAVEN_HOME directory does not exist: ${MAVEN_HOME}"
+  exit 1
+fi
+
+if [ ! -f "${MAVEN_HOME}/bin/mvn-original" ]; then
+  echo "ERROR: mvn-original not found at: ${MAVEN_HOME}/bin/mvn-original"
+  exit 1
+fi
+
+# Try multiple possible locations for the toolchains file
+TOOLCHAIN_LOCATIONS=(
+  "${BASEDIR}/dev-support/toolchains-jenkins.xml"
+  "$(pwd)/dev-support/toolchains-jenkins.xml"
+  "./dev-support/toolchains-jenkins.xml"
+  "../dev-support/toolchains-jenkins.xml"
+)
+
+TOOLCHAIN=""
+for location in "${TOOLCHAIN_LOCATIONS[@]}"; do
+  echo "Checking for toolchains file at: $location"
+  if [ -f "$location" ]; then
+    TOOLCHAIN="$location"
+    echo "Found toolchains file at: $TOOLCHAIN"
+    break
+  fi
+done
+
+if [ -n "$TOOLCHAIN" ]; then
   echo "Added: -t ${TOOLCHAIN} to mvn flags!"
-  exec ${MAVEN_HOME}/bin/mvn-original "$@" -t "$TOOLCHAIN"
+  echo "Executing: ${MAVEN_HOME}/bin/mvn-original $@ -t $TOOLCHAIN"
+  "${MAVEN_HOME}/bin/mvn-original" "$@" -t "$TOOLCHAIN"
+  exit_code=$?
 else
-  echo "Unexpected: ${TOOLCHAIN} file is missing!"
-  exec ${MAVEN_HOME}/bin/mvn-original "$@"
+  echo "Warning: toolchains-jenkins.xml file not found in any expected 
location!"
+  echo "Searched locations:"
+  for location in "${TOOLCHAIN_LOCATIONS[@]}"; do
+    echo "  - $location"
+  done
+  echo "Proceeding without toolchains configuration..."
+  echo "Executing: ${MAVEN_HOME}/bin/mvn-original $@"
+  "${MAVEN_HOME}/bin/mvn-original" "$@"

Review Comment:
   this fallback at least builds code, should not happen again though, but 
maybe with some yetus upgrade or dockerfile change



-- 
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: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to