wood burning stoves*
The moose likes Ant, Maven and Other Build Tools and the fly likes Unable to change the local repository settings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Unable to change the local repository settings" Watch "Unable to change the local repository settings" New topic

Unable to change the local repository settings

Padma Priya
Ranch Hand

Joined: Feb 01, 2007
Posts: 113
Hi all,

I am using apache-maven-2.2.1. I tried changing the local repository settings(by changing the <localRepository>D:/maven_repo</localRepository>
) in settings.xml file under D:\JavaProjects\apache-maven-2.2.1\conf dir from C:\Users\deepthi\.m2 to d:\maven_repo directory.

But everytime all the dependencies are downloaded to C:\Users\deepthi\.m2 only. How can i override the default behaviour and download all my dependencies to d:\maven_repo
Martijn Verburg

Joined: Jun 24, 2003
Posts: 3274

Typically there are two settings files, one in the core install of Maven itself and the other one in your .m2 directory, I would edit the one in the .m2 directory (or create one there with the new directory that you want to point to).

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Peter Johnson

Joined: May 14, 2008
Posts: 5812

Are you sure that the Maven you are running is the one in D:\JavaProjects\apache-maven-2.2.1? (Martijn's recommendation will avoid this issue...)

Also, what change did you make to settings.xml?

I changed my conf/settings.xml file to relocate the repository on my PC and that works just fine for me.

JBoss In Action
subject: Unable to change the local repository settings
Similar Threads
Maven - Error merging velocity templates: C:\Windows\system32\my-app\pom.xml
Change maven local repository in Sonatype plug for eclipse
How to set an output directory
Trouble with running Maven Tomcat plugin through Eclipse
Maven doesn't take localRepository setting