fix: maven download failure (silently not failing the build)#163
Open
silvestre wants to merge 2 commits into
Open
fix: maven download failure (silently not failing the build)#163silvestre wants to merge 2 commits into
silvestre wants to merge 2 commits into
Conversation
Port install-java-tools.sh changes from actions/runner-images#13993: - When `.java.maven` is a bare major version (e.g. "3"), curl Maven's metadata XML and select the latest matching patch release via sort -V - Fall back to the literal value if a full version string is given - Exit with an error if version resolution fails - Update download URL and symlink to use the resolved version Co-authored-by: Sergei Pyshnoi <121864472+v-sergei-pyshnoi@users.noreply.github.com>
# Issue A failing download of `maven` (e.g. https://github.com/catthehacker/docker_images/actions/runs/25560074274/job/75035927400#step:13:556) did not fail the build, as `download_with_retries` used `return 1` on exhausted retries, which does not trigger bash's `errexit` when a function is called as a plain statement. # Fix Port `download_with_retry` from actions/runner-images#8912 (by @vpolikarpov-akvelon), replacing `download_with_retries` across `install.sh`, `java-tools.sh`, and `yq.sh`. The new implementation drops the `set +e`/`set -e` errexit juggling entirely and uses `exit 1` instead of `return 1` on failure, which terminates the script unconditionally regardless of how the function was called. Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com>
silvestre
marked this pull request as ready for review
May 11, 2026 12:43
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.
Issues
Maven installation broken by upstream toolset change
This repo fetches
toolset.jsonlive fromactions/virtual-environments@mainat build time. Upstream actions/runner-images#13993 changed"maven": "3.9.15"to"maven": "3"in that toolset, but this repo had not yet ported the accompanying dynamic version resolution logic fromjava-tools.sh. As a result, the download URL was constructed as.../maven-3/3/binaries/apache-maven-3-bin.zip, a path that does not exist, returning HTTP 404 on all 20 retry attempts. Closes #164.Failing downloads not failing the build
download_with_retriesusesreturn 1on exhausted retries, which does not trigger bash'serrexitwhen a function is called as a plain statement. The build continued past the Maven download failure,unzipfailed silently on an empty file, and subsequent steps ran as if nothing had gone wrong.Fix
Dynamic Maven version resolution
Ported from actions/runner-images#13993 by @v-sergei-pyshnoi.
java-tools.shnow accepts a bare major version (e.g."3") in the toolset config. When detected, it resolves the latest matching release by parsing Maven's metadata XML, selecting the newest patch version viasort -V. This means builds always pick up the current latest release without requiring manual version bumps.Robust download failure handling
Ported from actions/runner-images#8912 by @vpolikarpov-akvelon.
download_with_retriesis replaced withdownload_with_retry. The new implementation drops theset +e/set -eerrexit juggling entirely and usesexit 1instead ofreturn 1on failure, terminating the script unconditionally regardless of how the function was called. All three call sites (install.sh,java-tools.sh,yq.sh) are updated accordingly.