什么时候可以安全删除本地Maven存储库? [英] When is it safe to delete the local Maven repository?

查看:80
本文介绍了什么时候可以安全删除本地Maven存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在哪种情况下,对rm -rf ~/.m2/repository来说分别是安全的,前提是我正在在线工作并且可以通过远程存储库访问所有需要的工件.

In which circumstances is it safe respectively unsafe to rm -rf ~/.m2/repository provided that I'm working online and I have access to all needed artifacts via remote repositories.

推荐答案

从远程存储库检索所有依赖项时,本地存储库仅不过是一个缓存.

When you retrieve all dependencies from remote repositories, then the local repo becomes nothing more than a cache.

与所有缓存一样,Maven本地存储库有时可能会变成脏"文件.在公认的偏执狂和过度杀伤行为中,我安排了定期的cron工作来清除构建机器上的本地存储库.这将强制与我的Nexus Maven存储库重新同步.

Like all caches, the Maven local repo can occasionally become "dirty". In an acknowledged act of paranoia and overkill, I schedule a periodic cron job to purge the local repositories on my build machines. This forces a re-sync with my Nexus Maven repository.

这篇关于什么时候可以安全删除本地Maven存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆