nddipiazza commented on PR #2510:
URL: https://github.com/apache/tika/pull/2510#issuecomment-3702450627
## About the Maven Caching Change
Added `cache: 'maven'` to all `setup-java@v4` steps.
**What it does:**
- Caches `~/.m2/repository` between CI runs
- Uses `hashFiles('**/pom.xml')` to invalidate cache when dependencies change
- Built-in feature of setup-java@v4 action
**Benefits:**
- Saves ~30-60 seconds per build by avoiding repeated dependency downloads
- Reduces bandwidth usage
- No code changes required - just one line per workflow
**How it works:**
```yaml
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven' # ← This enables caching
```
This is equivalent to manually using `actions/cache@v4` but more concise.
See [setup-java caching
docs](https://github.com/actions/setup-java#caching-packages-dependencies).
The cache will be automatically invalidated if any pom.xml files change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]