3

In STS 3.7.3 where I one Maven project.

When I run maven install, it will download dependencies from some remote repositories, however The dependencies are placed in a folder named "%USERPROFILE%" (.m2 is inside this folder) which is created inside the project root folder.

Don´t know why is being created there and not in the user´s home (in windows, C:\Users) .

STS is Using an external maven installation For the Maven Configuration in STS for Maven (Under Windows -> Preferences -> Maven) 1) I am using a custom user settings which include some remote repositories (settings.xml is C:\maven\settings.xml)

2) Local Repository variable says: C:\sts-3.7.3.RELEASE-64\%USERPROFILE%.m2\repository (This is not editable)

would like the local repository to use the user´s home folder. Any help?

kandan
  • 715
  • 2
  • 12
  • 39

1 Answers1

2

Probably you can fix that editing the file: C:\maven\settings.xml

Maybe the path that you have there starts with a . setting the repository to the path where you are starting the maven process.

In this XML you can inform the tag with the path that you want to be the maven repository.

<localRepository>/path/to/local/repo</localRepository>
Marcel Dias
  • 4,271
  • 1
  • 14
  • 10
  • I added property to the settings.xml (by editing the settings.xml pointed by Global Settings input) so it overwrites the default behaviour (writing to %USERPROFILE% folder) and seemed to work : C:/MavenRepository/.m2/repository/. couldnt use user.home variable inside settings.xml because it goes to this %USERPROFILE% folder. Seems is related: http://stackoverflow.com/questions/2134338/java-user-home-is-being-set-to-userprofile-and-not-being-resolved – kandan May 18 '16 at 08:07