0

I am trying to set up the maven on my machine. I set the M2_HOME point to apache maven folder. There is one file called setting.xml inside my home folder followed by .m2 folder. But problem when I try to debug/compile the maven its show some different location which is not exist even my system. so I am one of user of Linux machine so I did all setting for my user account but do not have write to override any of admin setting.

so when i try to compile using mvn then its says

[DEBUG] Reading global settings from F:\TestSystems\Naveen\project\apahce-maven-3.2.3\conf\settings.xml
[DEBUG] Reading user setting from \\corp136\tsdata\testsystems10\.m2\settings.xml

see the second line this location is not exist into my machine or not related to my user account So my question can i force to maven to read settings.xml file for some specific location just like local repo.

keepmoving
  • 1,813
  • 8
  • 34
  • 74
  • 1
    Possible duplicate of [maven command line how to point to a specific settings.xml for a single command?](http://stackoverflow.com/questions/25277866/maven-command-line-how-to-point-to-a-specific-settings-xml-for-a-single-command) – Tunaki Feb 27 '16 at 11:12

1 Answers1

3

Use -s or -gs Maven command line options for defining your settings.xml file path.

See 6.1.6. Using a Custom POM or Custom Settings File

Andriy Kryvtsun
  • 3,220
  • 3
  • 27
  • 41
  • Its working. But still I do not why maven is not getting the my account m2 setting.xml. Its shows some different local that does not exist in my machine. Do we some command in maven which can tell the absolute path of maven. – keepmoving Feb 27 '16 at 15:18
  • @Naveen look on this Maven [configuration setup](https://maven.apache.org/settings.html) explanation – Andriy Kryvtsun Feb 27 '16 at 16:29
  • @Naveen here is [step-by-step manual](http://www.mkyong.com/maven/where-is-maven-local-repository/) how to change you Maven repo location – Andriy Kryvtsun Feb 27 '16 at 16:30