Skip to content

Is it safe to delete Maven target folders?

Build output that Maven creates in each project, such as compiled classes, test reports and packaged JAR or WAR files.

Safe

Its owner recreates it by itself when it needs it, and nothing you made is lost.

~/**/target

  • Only next to pom.xml
  • Never inside ~/Library

What it is

Maven writes everything a build produces into a target folder next to the project's pom.xml file. It creates the folder again the next time you build, and Maven's clean step removes it the same way. Your source code isn't affected.

If it's removed

The next build of each project is a full build. Packages you built are removed until you build them again.

How it's removed

Moved to the Trash, where you can restore it.

PRO

The free analyzer finds it and explains it. Removing it is Pro, after a review sheet that lists every move and command. It starts checked in the Cleanup checklist, except inside Documents or Desktop.

Sources

Last checked on 26 Sep 2026. Every entry is written and checked by hand; the app and the command-line tool use the same words.