Sunday, July 15, 2012

Configuring Maven Local Repository

What is Maven Local Repository?

Maven local repository is the place on your machine where all the dependency libraries of your project which have been downloaded using Maven are stored. These files usually include plugin jars. 

Maven Configuration File:

Maven local repository is defined in it's configuration file which is usually located under directory \conf with name settings.xml.

Changing Default Maven Repository:

By default on windows 7, the maven local repository is set for C:\Users\user_name\.m2\. You can change this by editing the settings.xml
In the settings.xml look for the commented localRepository definition which looks like:
 

Either un-comment it or add the following line:
D:/dev/maven_repo
Save the file and you are done. Now all the future dependencies will be downloaded to the path you set. 


Refer to the Maven Repositories and Configuration post to see what types of Maven repositories are there and how you can configure them.

No comments: