Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using Maven 3.0, and my .m2 folder location is C:Usersme.m2.

However, I do not have write access to that folder, but I want to change the repository location from the one defined in the settings.xml.

Due to restricted access, I am not able to edit the settings.xml to change the repository location.

How can I override the values of my settings.xml -or change the default location of the .m2 folder- without editing my C:Usersme.m2confsettings.xml file?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
691 views
Welcome To Ask or Share your Answers For Others

1 Answer

You need to add this line into your settings.xml (or uncomment if it's already there).

<localRepository>C:Usersme.m2
epo</localRepository>

Also it's possible to run your commands with mvn clean install -gs C:Usersme.m2settings.xml - this parameter will force maven to use different settings.xml then the default one (which is in $HOME/.m2/settings.xml)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...