Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find out which settings.xml file maven is using

I recently changed my password and have to change my maven settings.xml file to reflect that. However, no matter what I do in the settings.xml file, the changed password just won't get picked up. Out of desperation, I ran maven with the -s switch (mvn -s <my intended settings.xml file>) and everything just started working. It seems to suggest that maven by default is using a "wrong" settings.xml

Is there a way for me to figure out where the settings.xml file that maven is using is located?

like image 670
RAY Avatar asked Sep 26 '22 19:09

RAY


People also ask

How do you know which settings xml Maven is using?

mvn help:effective-settings shows the effective settings of the current environment including your location of settings. xml file. Additionally showPasswords=true will help you see the passwords resolved as well if you are using environment variables.

How do you check which settings xml Maven is using in eclipse?

Open your Eclipse and go to Window -> Preferences. Click on the Browse button of User Settings , and select the settings. xml.


1 Answers

Use the Maven debug option, ie 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
...

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

like image 259
ndeverge Avatar answered Oct 09 '22 20:10

ndeverge