From 00632754abea171be7d18b276d62384fd596fd5b Mon Sep 17 00:00:00 2001 From: BrianHotopp Date: Fri, 10 Apr 2026 01:31:52 -0400 Subject: [PATCH] [2.x] fix: Add --fail to curl in launcher to prevent corrupt jars (#9003) When the download URL returns an HTTP error (e.g. 404), curl without --fail exits 0 and saves the error page HTML as the jar file. This leaves a corrupt jar that causes confusing errors on subsequent runs. With --fail, curl returns a non-zero exit code on HTTP errors and does not write the response body to the output file. Fixes #6654 Co-authored-by: Claude Opus 4.6 (1M context) --- sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbt b/sbt index 5ab69d315..c32343fe0 100755 --- a/sbt +++ b/sbt @@ -142,7 +142,7 @@ download_url () { local jar="$2" mkdir -p $(dirname "$jar") && { if command -v curl > /dev/null; then - curl --silent -L "$url" --output "$jar" + curl --fail --silent -L "$url" --output "$jar" elif command -v wget > /dev/null; then wget --quiet -O "$jar" "$url" else