What it is
Every Java library Maven (and some Gradle setups) downloaded.
Can you delete it?
Yes, it is rebuilt automatically. Libraries are downloaded again on the next build. Exception: artifacts you installed yourself with mvn install and cannot rebuild.
How to clean it safely
- See the size: du -sh ~/.m2/repository
- Delete subfolders of libraries you no longer use, or the whole folder if you can rebuild everything.
How big is it on your Mac?
This read-only command prints its size and changes nothing:
Terminal
du -sh ~/".m2/repository" 2>/dev/nullStep-by-step guide: Developer caches on a Mac →
Related folders
- JetBrains IDE caches ·
~/Library/Caches/JetBrains - Flutter SDK cache ·
<flutter sdk>/bin/cache - Hex packages (Elixir) ·
~/.hex - Composer cache (PHP) ·
~/Library/Caches/composer - Puppeteer browsers ·
~/.cache/puppeteer - Cursor cache ·
~/Library/Application Support/Cursor/Cache
Questions
Is it safe to delete ~/.m2/repository?
Yes, it is rebuilt automatically. Libraries are downloaded again on the next build. Exception: artifacts you installed yourself with mvn install and cannot rebuild.
Let the raccoon do it, safely
Junk Raccoon finds this clutter for you, shows every file first, and keeps a one-click way back. Free to download, no account, no ads.
Download for Mac