Skip to content

fix: invalidate maven cache on pom.xml changes#649

Merged
nookyo merged 1 commit intoNetcracker:mainfrom
TaurMorchant:fix/maven-cache-improvement
Mar 13, 2026
Merged

fix: invalidate maven cache on pom.xml changes#649
nookyo merged 1 commit intoNetcracker:mainfrom
TaurMorchant:fix/maven-cache-improvement

Conversation

@TaurMorchant
Copy link
Copy Markdown
Contributor

Pull Request

Summary

Problem: the current cache key depends only on the runner OS, so it is never invalidated when maven dependencies change. As a result, the same cache may be reused indefinitely even after pom.xml updates.

Proposed solution: include a hash of pom.xml files in the cache key so the cache is invalidated when the dependency configuration changes, while still allowing fallback restores via a prefix key.

Trade-offs: existing caches in target repositories will not match the new key, so the first build after this change will not get a cache hit and will need to download all dependencies.

Issue

This ensures the maven cache stays aligned with the current dependency configuration. When dependencies change, a new cache is created, keeping the cache closer to the actual state and reducing the amount of dependencies that need to be downloaded during builds.

Breaking Change?

  • Yes
  • No

Scope / Project

Workflows

@nookyo nookyo merged commit 321b88a into Netcracker:main Mar 13, 2026
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants