CI / GitHub workflow: Cache Maven Wrapper artifacts#3329
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds Maven wrapper distribution caching to the continuous-integration-workflow.yml file. The change inserts an Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
At the time of writing, |
Our GitHub workflow uses the 'maven' cache that's provided by the `actions/setup-java` action.
I was surprised to see the following build failure earlier today:
```
Run ./mvnw -B install --file pom.xml
./mvnw -B install --file pom.xml
shell: /usr/bin/bash -e {0}
env:
CI: true
REGISTRY: ghcr.io
IMAGE_NAME: openfire
JAVA_HOME: /opt/hostedtoolcache/Java_Zulu_jdk/25.0.3-9/x64
JAVA_HOME_25_X64: /opt/hostedtoolcache/Java_Zulu_jdk/25.0.3-9/x64
Error: Exception in thread "main" java.io.IOException: Server returned HTTP response code: 429 for URL: https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1713)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1305)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:223)
at org.apache.maven.wrapper.DefaultDownloader.downloadInternal(DefaultDownloader.java:100)
at org.apache.maven.wrapper.DefaultDownloader.download(DefaultDownloader.java:86)
at org.apache.maven.wrapper.Installer.createDist(Installer.java:84)
at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:160)
at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:73)
Error: Process completed with exit code 1.
```
This shows that Maven is still being downloaded, instead of the wrapped version being cached/used.
Apparently, the 'maven' cache from the `actions/setup-java` action does not cache these artifacts. With the changes in this commit, they now should.
103431f to
2289e3c
Compare
Fishbowler
left a comment
There was a problem hiding this comment.
Seems reasonable.
Nitpick on the version used.
| distribution: ${{ matrix.distribution }} | ||
| cache: maven | ||
| - name: Cache Maven wrapper distribution | ||
| uses: actions/cache@v4 |
There was a problem hiding this comment.
Any reason to avoid vLatest?
| uses: actions/cache@v4 | |
| uses: actions/cache@v5 |
Our GitHub workflow uses the 'maven' cache that's provided by the
actions/setup-javaaction.I was surprised to see the following build failure earlier today:
This shows that Maven is still being downloaded, instead of the wrapped version being cached/used.
Apparently, the 'maven' cache from the
actions/setup-javaaction does not cache these artifacts. With the changes in this commit, they now should.