Every artifact downloaded from maven central comes with a .sha1
file. Is there any way to force maven (or using a bash script) to re-validate the correctness of all its artifacts? I know that just deleting .m2
is usually the recommended way when there's doubts about repo corruption, but if maven has checksums I imagine it is because there is a way to validate the artifacts
I couldn't find anything using maven but this solution using bash worked for me
shopt -s globstar; for f in ~/.m2/**/*.jar; do if [[ -f $f.sha1 && $(sha1sum $f | cut -f1 -d " ") != $(cat $f.sha1 | cut -f1 -d " ") ]]; then echo Bad jar: $f; fi; done