# Is it safe to delete ~/.m2/repository on Mac?

- URL: https://moreroom.app/folders/maven-repository
- Item: Maven repository
- Location: `~/.m2/repository`
- Verdict: Safe to remove — Rebuilt or re-downloaded automatically when needed.
- Comes back on its own: yes
- Source: MoreRoom rules catalogue (2026-10-17), by Yando Pte. Ltd.

## What is it?

Maven’s local repository: every library and plugin Maven has downloaded for your projects, plus anything you installed locally with `mvn install`. Other tools, such as Gradle builds that use `mavenLocal()`, can read it too. Old versions are never removed automatically, so it often reaches several gigabytes.

## What happens if you delete it?

Maven downloads dependencies again on the next build, which takes time and bandwidth. Artifacts that existed only locally, built with `mvn install`, are gone until you rebuild them.

## How to remove it properly

Make sure no build is running, then move `~/.m2/repository` to the Trash with Finder’s Go › Go to Folder…. Keep `~/.m2/settings.xml`, which holds your repository settings and credentials.

## Before you delete it

If you rely on locally installed snapshots of your own modules, rebuild and install them before working offline.
