Enterprise Cache - will cache hit/miss with different semver build tag

Hello everyone. I have searched the archives but not found an answer.

I work in a maven-based java environment where semantic versioning is used, including the build tag part.

Snapshots are automatically created for each team, so that there are many versions


These versions are created automatically but not developed on wholly in parallel, so there are many times when 1.2.3-teama-SNAPSHOT and 1.2.3-teamb-SNAPSHOT will be exactly the same from a code/input perspective.

My assumption is that for gradle enterprise cache, this would still be a cache miss, because they are different versions.

Can anyone confirm the accuracy of that assumption? And if it is a valid assumption, does anyone know a way around it? The naming strategy is deeply embedded and not something I could practically change.

Many thanks!

I guess with “Enterprise Cache” you just mean normal build cache / remote build cache?
The version is only relevant if it is relevant.
Task file outputs are what is cached.
So if the version does not influence the inputs of a task, the outputs should be taken from cache.

Thanks for replying @Vampire - I mean the remote build cache:


I understand in gradle you can explicitly declare what is and isn’t an input in terms of caching, and what should be considered when creating the hash used as a key. Because my question is regarding the maven plugin I have less flexibility declaring inputs, so my question is fundamentally…

a) whether or not the maven plugin would consider different artifact versions as different things altogether, and so wouldn’t cache them
b) whether the maven plugin would consider them as the same artifact to be cached, but might include an artifact-id somewhere, such as whether the pom file is an input which has the artifact version present and so would be a ‘different’ input.

My expectation is that either or even both of those are true, but I am hopeful someone can clarify.

Oh, sorry, somehow didn’t get the Maven-detail.
Then I have no idea, I try not to touch Maven with a five-foot-pole if I can prevent it. :smiley:

But skimming over Gradle Enterprise Maven Extension User Manual | Gradle Enterprise Docs I’d say it is similar to how it is in in Gradle.
Things like packing a jar is not cacheable anyway.
Only things like compilation, test execution, javadoc generation, …
So if you for example use the full version to give it to the javadoc generation that it appears in the generated files, it probably would cause a cache miss.
Java compilation (unless you generate the version information into some source file) probably is not affected.
But just assuming here.

Yeah I’m expecting it is pretty niche - I’m sure the enterprise cache is used by maven houses in places but there isn’t too much information out there in the wild.

Thanks for taking the time to look though, I appreciate it :slight_smile: