Skip to content

Commit 86ce8e6

Browse files
brunoborgesCopilot
andauthored
docs: clarify Maven cache paths and key hash inputs (#1096)
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>
1 parent 90be272 commit 86ce8e6

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎docs/advanced-usage.md‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,14 @@ To run the JavaFX application in CI:
289289
## Ensuring the Maven cache is complete (plugin dependencies)
290290

291291
When you enable `cache: maven`, the action caches your local Maven repository
292-
(`~/.m2/repository`) keyed on a hash of your `pom.xml` files, and — at the end of
293-
the job — saves whatever was downloaded during that run. It does **not** re-save
294-
the cache when the key already matches (a cache *hit*).
292+
(`~/.m2/repository`) and downloaded Maven Wrapper distributions
293+
(`~/.m2/wrapper/dists`). The cache key is a hash of your Maven inputs — every
294+
`**/pom.xml`, plus `**/.mvn/wrapper/maven-wrapper.properties` and
295+
`**/.mvn/extensions.xml` — so changing any of those files (for example bumping
296+
the wrapper version or editing core extensions) produces a new key and
297+
invalidates the cache. At the end of the job the action saves whatever was
298+
downloaded during that run. It does **not** re-save the cache when the key
299+
already matches (a cache *hit*).
295300

296301
Maven resolves **plugin** dependencies lazily: it only downloads the plugins and
297302
plugin dependencies required by the goals that actually execute. As a result, the

0 commit comments

Comments
 (0)