Getting at least some benefit from pipeline caching when over 1GB limit Edited

I have bb pipeline caching enabled. At the build end I see,

 

 

Build teardown1m 31s

Cache "maven": Compressing

Cache "maven": Compressed

Cache "maven": Compressed size is larger than upload limit (1 GB more than the 1 GB limit). Skipping cache upload.

 

 

Is there anyway I can use the 1 GB to provide some benefit. If I could blacklist certain jars that would help.

Could I run a script at the run of the build to delete part of ~/.m2/repository?

1 answer

I added this script to the pipelines configuration. At the end of the build with deletes the artifacts generated by the build which reduced the M2 repo directory to < 1GB.

#!/usr/bin/env bash

# mvn -B help:evaluate -Dexpression=settings.localRepository
du -sh /root/.m2/repository/*
echo
du -sh /root/.m2/repository/com/*
echo
du -sh /root/.m2/repository/org/*
echo
echo "Total size:"
du -sh /root/.m2/repository/

# 1.5G	/root/.m2/repository/com/inferess
echo "Deleting from /root/.m2/repository/com/inferess"
rm -rf /root/.m2/repository/com/inferess
echo
echo "Total size:"
du -sh /root/.m2/repository/

## 130M	/root/.m2/repository/org/apache
#echo "Deleting from /root/.m2/repository/org/apache"
#rm -rf /root/.m2/repository/org/apache
#echo
#echo "Total size:"
#du -sh /root/.m2/repository/

The commented out code allowed me to identify candidates for deletion.

It would be useful to have an option to Maven caching to list paths under the repo to exclude from the cached repo. I will never need to cache artifacts the build will create.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira Service Desk

Wy are we still using email for Service Desk workflows?

...attest to the experience of an urgent approval that gets lost in the boss’s inbox and requires that special “Please Approve” email or text message. In an age where we have distributed teams...

114 views 0 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you