When is it safe to delete the local Maven repository?

If you have access to all needed artifacts via remote repos, it is always safe to remove local Maven repository. All artifacts needed to the next build, including even basic Maven plugins (like compiler) will be basically fetched from remote repos. That's it.


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.

Tags:

Maven