aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 112
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: 5772

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
I agree. Here's the link:
subject: Unable to change the local repository settings
Similar Threads
Maven doesn't take localRepository setting
Trouble with running Maven Tomcat plugin through Eclipse
How to set an output directory
Change maven local repository in Sonatype plug for eclipse
Maven - Error merging velocity templates: C:\Windows\system32\my-app\pom.xml