Skip to content

builds are not stable due to failure to downlaod apache-maven-X.XX.X-bin.zip #22020

Description

@romani

https://dev.azure.com/romanivanovjr/romanivanovjr/_build/results?buildId=49000&view=logs&jobId=f4709c66-831f-5fab-6fd3-e9e422df8e64&j=f4709c66-831f-5fab-6fd3-e9e422df8e64&t=5ef834cf-dfcf-5f34-8886-ec506cb56abe

Starting: Bash
==============================================================================
Task         : Bash
Description  : Run a Bash script on macOS, Linux, or Windows
Version      : 3.279.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
==============================================================================
[Host] Selected Node version: Node24 (Strategy: Node24Strategy)
Generating script.
========================== Starting Command Output ===========================
/usr/bin/bash /home/vsts/work/_temp/c9e6931c-c04f-4e65-9992-414a2e39e671.sh
wget: Failed to fetch https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.10.0/apache-maven-3.10.0-bin.zip

##[error]Bash exited with code '1'.
Finishing: Bash

is there way to make it more stable ?? can we do some retry ?

~/.m2/wrapper/dists$ pwd
/home/roman/.m2/wrapper/dists

~/.m2/wrapper/dists$ ls -1
apache-maven-3.10.0
apache-maven-3.10.0-bin
apache-maven-3.9.16
apache-maven-3.9.16-bin
apache-maven-3.9.6
apache-maven-3.9.6-bin
apache-maven-3.9.9

Activity

  1. anushkagupta200615-jpg commented on Oct 17, 2026

    @anushkagupta200615-jpg
    Contributor

    i am on it

  2. anushkagupta200615-jpg commented on Oct 17, 2026

    @anushkagupta200615-jpg
    Contributor

    Yes, we can definitely make this more stable with two targeted improvements:

    1. Add a retry loop for Maven Wrapper initialization:
      In azure-pipelines.yml, every matrix job runs ./mvnw --version as its first step. If transient network issues or rate limiting occur while fetching apache-maven-X.XX.X-bin.zip, mvnw cleans up its temp directory and aborts. Wrapping ./mvnw --version in a retry loop (e.g., up to 5 attempts with a 5-second backoff) will retry the download without restarting the entire build or test suite.

    2. Fix Maven Wrapper caching in Azure Pipelines:
      Currently, the Cache@2 task caches .mvn/wrapper (which only contains maven-wrapper.properties in git) rather than the actual binary distribution cache in ~/.m2/wrapper (similar to the fix in PR Issue #21999: Cache maven wrapper in pitest workflow #22002 for pitest.yml). Defining MAVEN_USER_HOME: $(Pipeline.Workspace)/.m2 and caching $(Pipeline.Workspace)/.m2/wrapper ensures that cached jobs won't even need to re-download the zip from Maven Central.

  3. romani commented on Oct 17, 2026

    @romani
    MemberAuthor

    Fix Maven Wrapper caching in Azure Pipelines:

    lets try this

  4. added 2 commits that reference this issue on Oct 17, 2026
  5. romani commented on Oct 17, 2026

    @romani
    MemberAuthor

    sound like the same problem at CircleCI too https://app.circleci.com/pipelines/github/checkstyle/checkstyle/53155/workflows/9cbb8bb3-d50c-4e1d-88d5-472924a85146/jobs/1922513

    wget: Failed to fetch https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.10.0/apache-maven-3.10.0-bin.zip
    Failed to get Checkstyle POM version.
    
    Exited with code exit status 1
    
    
  6. added a commit that references this issue on Oct 17, 2026
  7. anushkagupta200615-jpg commented on Oct 17, 2026

    @anushkagupta200615-jpg
    Contributor

    Yes, that's because CircleCI's Maven cache is currently not caching ~/.m2 at all.

    In .circleci/config.yml (lines 42 and 113), the cache path is configured as:

    paths:
      - .m2

    Because it is missing the ~/ prefix, CircleCI treats it as relative to the working directory (~/project/.m2), which does not exist. As a result, ~/.m2/repository and ~/.m2/wrapper are never saved or restored, forcing every CircleCI job to download apache-maven-3.10.0-bin.zip over the network each time.

    Changing it to ~/.m2 (or ~/.m2/repository and ~/.m2/wrapper) will restore the wrapper cache in CircleCI.

    Would you like me to open a separate issue/PR for CircleCI, or include it in this issue?

  8. romani commented on Oct 17, 2026

    @romani
    MemberAuthor

    same issue, separate PR

  9. added a commit that references this issue on Oct 18, 2026
  10. 2 remaining items

  11. added this to the 14.4.0 milestone on Oct 18, 2026
  12. Krish-876 commented on Oct 30, 2026

    @Krish-876
    Contributor

    Hi @romani, @anushkagupta200615-jpg, From what I can see, the GitHub Actions workflows other than pitest.yml don't seem to cache ~/.m2/wrapper, which might mean the Maven distribution is downloaded on every run. Please correct me if I'm missing something. Is anyone already working on this? If not, I could start with windows-verify.yml and error-prone.yml, following the pattern from #22002. @romani, would it be okay to split the remaining workflows into separate PRs?

  13. anushkagupta200615-jpg commented on Oct 30, 2026

    @anushkagupta200615-jpg
    Contributor

    Hi @Krish-876,
    I am actually working on this now and will be opening the PR shortly. Thanks for checking!

  14. added a commit that references this issue on Nov 1, 2026
  15. reopened this on Nov 1, 2026
  16. romani commented on Nov 1, 2026

    @romani
    MemberAuthor

    Circle Ci update is merged at #22034

  17. added a commit that references this issue on Nov 1, 2026
  18. modified the milestones: 14.4.0, 14.4.1 on Nov 1, 2026
  19. romani commented on Nov 2, 2026

    @romani
    MemberAuthor

    Is there any other CI config that missing this update ?

  20. anushkagupta200615-jpg commented on Nov 2, 2026

    @anushkagupta200615-jpg
    Contributor

    Yes, two GitHub Actions workflows invoke ./mvnw to build Checkstyle but currently lack a Maven/wrapper cache step:

    • no-error-workflow.yml (no-error-kafka and no-error-trino)
    • no-exception-workflow.yml (all 4 openjdk jobs)

    Other CIs (Semaphore, Buildkite, AppVeyor) already cache .m2.

    I will open a PR shortly to add the Maven and wrapper cache to both workflows.

  21. added a commit that references this issue on Nov 2, 2026
  22. romani commented on Nov 2, 2026

    @romani
    MemberAuthor

    lets keep this issue closed.
    If any more leftover found, we can always just reference this issue in new Pull/commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions