You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
builds are not stable due to failure to downlaod apache-maven-X.XX.X-bin.zip #22020
Yes, we can definitely make this more stable with two targeted improvements:
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.
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.
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
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?
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?
Activity
anushkagupta200615-jpg commentedon Oct 17, 2026
i am on it
anushkagupta200615-jpg commentedon Oct 17, 2026
Yes, we can definitely make this more stable with two targeted improvements:
Add a retry loop for Maven Wrapper initialization:
In
azure-pipelines.yml, every matrix job runs./mvnw --versionas its first step. If transient network issues or rate limiting occur while fetchingapache-maven-X.XX.X-bin.zip,mvnwcleans up its temp directory and aborts. Wrapping./mvnw --versionin 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.Fix Maven Wrapper caching in Azure Pipelines:
Currently, the
Cache@2task caches.mvn/wrapper(which only containsmaven-wrapper.propertiesin 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 forpitest.yml). DefiningMAVEN_USER_HOME: $(Pipeline.Workspace)/.m2and caching$(Pipeline.Workspace)/.m2/wrapperensures that cached jobs won't even need to re-download the zip from Maven Central.romani commentedon Oct 17, 2026
lets try this
Issue checkstyle#22020: Cache maven wrapper in azure pipelines
Issue checkstyle#22020: Cache maven wrapper in azure pipelines
romani commentedon Oct 17, 2026
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
Issue checkstyle#22020: Cache maven wrapper in azure pipelines
anushkagupta200615-jpg commentedon Oct 17, 2026
Yes, that's because CircleCI's Maven cache is currently not caching
~/.m2at all.In
.circleci/config.yml(lines 42 and 113), the cache path is configured as: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/repositoryand~/.m2/wrapperare never saved or restored, forcing every CircleCI job to downloadapache-maven-3.10.0-bin.zipover the network each time.Changing it to
~/.m2(or~/.m2/repositoryand~/.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?
romani commentedon Oct 17, 2026
same issue, separate PR
Issue #22020: Cache maven wrapper in azure pipelines
2 remaining items
Krish-876 commentedon Oct 30, 2026
Hi @romani, @anushkagupta200615-jpg, From what I can see, the GitHub Actions workflows other than
pitest.ymldon'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 withwindows-verify.ymlanderror-prone.yml, following the pattern from #22002. @romani, would it be okay to split the remaining workflows into separate PRs?anushkagupta200615-jpg commentedon Oct 30, 2026
Hi @Krish-876,
I am actually working on this now and will be opening the PR shortly. Thanks for checking!
Issue #22020: Cache maven repo and wrapper in CircleCI
romani commentedon Nov 1, 2026
Circle Ci update is merged at #22034
Issue #22020: Cache maven wrapper in github actions workflows
romani commentedon Nov 2, 2026
Is there any other CI config that missing this update ?
anushkagupta200615-jpg commentedon Nov 2, 2026
Yes, two GitHub Actions workflows invoke
./mvnwto build Checkstyle but currently lack a Maven/wrapper cache step:no-error-workflow.yml(no-error-kafkaandno-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.
Issue #22020: Cache maven wrapper in no-error and no-exception workflows
romani commentedon Nov 2, 2026
lets keep this issue closed.
If any more leftover found, we can always just reference this issue in new Pull/commit.