Two bugs introduced in the initial mvnw script:
1. apache-maven-3.9.6-bin.zip extracts into apache-maven-3.9.6/ (without
the -bin suffix), but MAVEN_HOME was set to $DISTRIBUTION_ID which
includes -bin. Fix: strip -bin suffix with ${DISTRIBUTION_ID%-bin}.
2. unzip without -o flag asks interactively when the cache directory
already contains files from a previous (partial) run. Fix: add -o
(overwrite silently).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fi
DISTRIBUTION_CACHE_DIR="$DISTRIBUTION_DIR/$URL_HASH"
-MAVEN_HOME="$DISTRIBUTION_CACHE_DIR/$DISTRIBUTION_ID"
+# The -bin.zip extracts into a directory without the -bin suffix
+MAVEN_HOME="$DISTRIBUTION_CACHE_DIR/${DISTRIBUTION_ID%-bin}"
if [ ! -x "$MAVEN_HOME/bin/mvn" ]; then
mkdir -p "$DISTRIBUTION_CACHE_DIR"
fi
log "Extracting to $DISTRIBUTION_CACHE_DIR"
- unzip -q "$DOWNLOAD_FILE" -d "$DISTRIBUTION_CACHE_DIR"
+ unzip -q -o "$DOWNLOAD_FILE" -d "$DISTRIBUTION_CACHE_DIR"
rm -f "$DOWNLOAD_FILE"
if [ ! -x "$MAVEN_HOME/bin/mvn" ]; then