mirror of
https://gitea.com/actions/setup-java.git
synced 2026-07-10 19:31:55 +08:00
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>
This commit is contained in:
@@ -289,9 +289,14 @@ To run the JavaFX application in CI:
|
|||||||
## Ensuring the Maven cache is complete (plugin dependencies)
|
## Ensuring the Maven cache is complete (plugin dependencies)
|
||||||
|
|
||||||
When you enable `cache: maven`, the action caches your local Maven repository
|
When you enable `cache: maven`, the action caches your local Maven repository
|
||||||
(`~/.m2/repository`) keyed on a hash of your `pom.xml` files, and — at the end of
|
(`~/.m2/repository`) and downloaded Maven Wrapper distributions
|
||||||
the job — saves whatever was downloaded during that run. It does **not** re-save
|
(`~/.m2/wrapper/dists`). The cache key is a hash of your Maven inputs — every
|
||||||
the cache when the key already matches (a cache *hit*).
|
`**/pom.xml`, plus `**/.mvn/wrapper/maven-wrapper.properties` and
|
||||||
|
`**/.mvn/extensions.xml` — so changing any of those files (for example bumping
|
||||||
|
the wrapper version or editing core extensions) produces a new key and
|
||||||
|
invalidates the cache. At the end of the job the action saves whatever was
|
||||||
|
downloaded during that run. It does **not** re-save the cache when the key
|
||||||
|
already matches (a cache *hit*).
|
||||||
|
|
||||||
Maven resolves **plugin** dependencies lazily: it only downloads the plugins and
|
Maven resolves **plugin** dependencies lazily: it only downloads the plugins and
|
||||||
plugin dependencies required by the goals that actually execute. As a result, the
|
plugin dependencies required by the goals that actually execute. As a result, the
|
||||||
|
|||||||
Reference in New Issue
Block a user