When is it safe to delete the local Maven repository?

前端 未结 4 1912
清歌不尽
清歌不尽 2020-12-10 01:27

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

4条回答
  •  隐瞒了意图╮
    2020-12-10 01:49

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

    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.

提交回复
热议问题