diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 49d2c37e8f..893bc4dd1e 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -141,6 +141,30 @@ jobs: persist-credentials: false ref: ${{ inputs.source-ref }} + - &restore-maven-wrapper + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ~/.m2/wrapper + key: maven-wrapper-${{ runner.os }}-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }} + + # Run inline because source-ref can select older revisions of the project. + - &bootstrap-maven + name: Bootstrap Maven distribution + shell: bash + run: | + for attempt in 1 2 3; do + if timeout --kill-after=5s 60s ./mvnw --version; then + exit 0 + else + status=$? + fi + if (( attempt == 3 )); then + exit "$status" + fi + echo "::warning::Maven wrapper setup failed (exit $status), retrying." + sleep 5 + done + - name: Resolve source revision id: source shell: bash @@ -183,6 +207,9 @@ jobs: cache: maven github-token: ${{ github.token }} + - *restore-maven-wrapper + - *bootstrap-maven + - name: Build native executable # Quarkus 3.39 switches on -H:+AOTSingleCallsiteInline for Mandrel 25.0.4+. The generated # REST invokers for AwsQueryController.dispatch and AwsJson11Controller.handle are each the @@ -223,6 +250,9 @@ jobs: cache: maven github-token: ${{ github.token }} + - *restore-maven-wrapper + - *bootstrap-maven + - name: Build native executable # Quarkus 3.39 switches on -H:+AOTSingleCallsiteInline for Mandrel 25.0.4+. The generated # REST invokers for AwsQueryController.dispatch and AwsJson11Controller.handle are each the