We have a Nexus local repository manager which handles all our internal projects (as well as mirroring outside repositories). For our internal projects, we only keep the most
On Linux, you can use this command:
find $HOME/.m2/repository/ \
-name "*-SNAPSHOT" \
-type d \
-mtime +60 \
-print \
-prune \
-exec rm -r "{}" \;
Explanation:
*-SNAPSHOT in the folder $HOME/.m2/repository/-exec will delete the folder, -prune tells find not to try to enter the folder afterwards.-exec will delete the folder and files inside.