Pipeline cache grows in size

Copper Contributor

Hi,

I have a Java-Maven build pipeline where I use pipeline caching to restore dependencies.

I see after like a month of pipeline usage the cache grows in size. Initially the size is around 1GB but later it crosses 12GB, what I'm concerned is if even if there is a cache miss, dependencies should get overridden , but this is getting appended. As a workaround I'm currently changing the cache key name to version2, version3 etc., so cache will be refreshed. Any insights would be appreciated. TIA

 

Task:

  - taskCache@2
    displayNameCache Maven repo on the build pipe line node
    inputs:
      key'version1 | maven | "$(Agent.OS)" | **/pom.xml'
      path$(Pipeline.Workspace)/.m2/repository
2 Replies
Thanks for response, but this doesn't help though.