How to clear Maven cache

Article ID:360055200412
1 minute readKnowledge base


My Maven cache is growing and I need to clear it out. How can I delete/clear my Maven cache?


Local Maven Repository location

When a Maven build is executed, Maven automatically downloads all the dependency jars into the local repository. Usually this folder is named .m2/repository.

  • To clear/delete your local maven repository cache, simply delete the .m2/repository folder.

  • You can find the default Local Maven Repository for each operating system below:

    Operating System Local Maven Repository







  • Additionally, if you are using the Maven Integration plugin you can find the Local Maven Repository inside the Jenkins UI by going to Manage Jenkins > Configure System > Local Maven Repository under Maven Project Configuration

  • The local repository path can also be configured in Maven setting.xml (either the global or the user one). See Maven documentation for more details.

  • Finally the local repository path can be overridden by the Maven Pipeline plugin using the mavenLocalRepo parameter.