Changing maven local repository
This is something that is not well documented on the web, though it is quite clearly in the default settings.xml file provided with the default Maven installation.
The default repository used by Maven 2 to store the various artifacts is <user_home>/.m2/repository. Under Windows, that translates to C:\Documents and Settings\<user>\.m2\repository.
On my client site, the size of the user home directory is severely restricted, presumably because it is being backed up. So, how do you change this value? Easy, once you know.
You need to have a settings.xml file, either in the <user_home>/.m2 directory, or in the <maven installation>/conf directory (make sure you keep a copy of the existing one). Add a new <localrepository> tag. On my machine, it looks like that:
<settings>… <localrepository>D:/mavenrepository</localrepository> <!– any type of slashes works –> … </settings>
That’s it!


Thanks a ton. I was looking for this information for quite some time. You saved my day.
Comment by partha — April 3, 2008 @ 11:03 pm
Thank you, very helpful.
Also at least in maven 2.0.9 its
D:\mavenrepository
notice the capitol R in repository
Comment by nthomas — April 18, 2008 @ 8:14 pm
Lol alright well its
>localRepository<C:\Tools\mavenRepo\repository<//localRepository>
Comment by nthomas — April 18, 2008 @ 8:16 pm