user3448331
user3448331

Reputation: 63

Maven downloading dependencies into project root instead of home/.m2

Whenever I run mvn in my project dir it always downloads the dependencies into that dir... I want it to download them into the main repo (home/.m2 )

enter image description here

Upvotes: 0

Views: 1271

Answers (1)

perbellinio
perbellinio

Reputation: 682

After a quick google search : how-to-get-the-maven-local-repo.

Run mvn -X and check on the first the line the one that start with:

[DEBUG] Using local repository at *YOUR_LOCAL_REPOSITORY*

If it is not the folder you want, you can change the value in your global settings or your user settings.

[DEBUG] Reading global settings from *YOUR_GLOBAL_SETTINGS*

[DEBUG] Reading user settings from *YOUR_USER_SETTINGS*

To change the value you have to add or update the element "localRepository" in one or both of the above settings file.

<localRepository>/path/to/local/repo/</localRepository>

Maven - Guide to Configuring Maven

Upvotes: 3

Related Questions