How to find out which settings.xml maven file is used

I recently changed my password and must change the maven settings.xml file to reflect this. However, no matter what I do in the settings.xml file, the changed password will simply not be raised. Out of desperation, I ran maven with the -s switch ( mvn -s <my intended settings.xml file> ), and everything just started working. Maven seems to use the "wrong" settings.xml by default

Is there any way to find out where the settings.xml file used by maven is located?

+80
maven configuration-files
Apr 03 '12 at 7:22
source share
1 answer

Use the Maven debugging option, i.e. mvn -X :

 Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100) Maven home: /usr/java/apache-maven-3.0.3 Java version: 1.6.0_12, vendor: Sun Microsystems Inc. Java home: /usr/java/jdk1.6.0_12/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-32-generic", arch: "i386", family: "unix" [INFO] Error stacktraces are turned on. [DEBUG] Reading global settings from /usr/java/apache-maven-3.0.3/conf/settings.xml [DEBUG] Reading user settings from /home/myhome/.m2/settings.xml ... 

On this output, you can see that the settings.xml file is loaded from /home/myhome/.m2/settings.xml .

+144
Apr 03 2018-12-12T00:
source share



All Articles