| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Explain that setup-java's maven cache only stores what a run downloads and is not re-saved on a hit, so plugin dependencies resolved lazily (e.g. by maven-shade-plugin) can be missing from the cache. Document a dependency resolution 'seed' step (dependency:go-offline + dependency:resolve-plugins) in README and a fuller advanced-usage section with a goal-comparison table, single-job and separate-seed-job examples, and caveats. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
#990) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…#705) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Documentation update explaining a common limitation of cache: maven in actions/setup-java: Maven plugin dependencies are resolved lazily, so an initial cache created by a “thin” goal may not include plugin deps, causing repeated downloads on subsequent CI runs.
Changes:
| File | Description |
|---|---|
| README.md | Adds a short note linking to the advanced guidance about seeding Maven plugin dependencies into the cache. |
| docs/advanced-usage.md | Adds a new section detailing the root cause and recommended seeding commands/workflow patterns to produce a more complete Maven cache. |
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Address post-merge review feedback on #1094: the intro paragraph described the cache too narrowly. setup-java caches both ~/.m2/repository and ~/.m2/wrapper/dists, and the default key hashes **/pom.xml plus .mvn/wrapper/maven-wrapper.properties and .mvn/extensions.xml, so changing wrapper/extensions files also invalidates the cache. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
Description:
With cache: maven, the action stores whatever a run downloads into ~/.m2 and does not re-save on a cache hit. Because Maven resolves plugin dependencies lazily (only for the goals that actually execute), a cache first created by a "thin" goal such as mvn compile never captures plugins bound to later phases. For example maven-shade-plugin and its dependencies (plexus-archiver, commons-compress, aircompressor, xz) are missing, so every later test/verify/package job re-downloads them on each run. The same effect hits parallel matrix jobs that each run a partial goal and race to save an incomplete cache (issue #705). This behavior was reproduced and confirmed on the current main.
This is a documentation-only change. It explains the behavior and shows how to seed a complete cache; it does not change the action's caching code.
The recommended seed is mvn -B dependency:go-offline dependency:resolve-plugins, verified to produce a superset that lets a subsequent build download nothing.
The section is honest about limits: the seed only helps on the run that creates the cache (an already-incomplete cache must be invalidated once), static resolution is not exhaustive (profile/module/execution-time gaps), and multi-module builds should seed at the reactor root. A closing note flags that cache: gradle has the same limitation and points Gradle users to gradle/actions/setup-gradle for complete dependency caching.
Related issue:
Fixes: #990
Addresses: #705
Check list: