Where is Maven's settings.xml located on Mac OS?

MacosRepositoryMaven 2

Macos Problem Overview


Where is Maven's settings.xml located on Mac OS?

Macos Solutions


Solution 1 - Macos

If you use brew to install maven, then the settings file should be in

/usr/local/Cellar/maven/<version>/libexec/conf

Solution 2 - Macos

It doesn't exist at first. You have to create it in your home folder, /Users/usename/.m2/ (or ~/.m2)

For example :

alt text

Solution 3 - Macos

if you install the maven with the brew

you can type the command("mvn -v") in Terminal

see Maven home detail

mvn -v
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.5", arch: "x86_64", family: "mac"

Solution 4 - Macos

I found it under /usr/share/java/maven-3.0.3/conf , 10.8.2

Solution 5 - Macos

->It is located in $MAVEN_HOME/conf/settings.xml... where $MAVEN_HOME is your environmental variable of Maven that you have downloaded. Else you can do like this also.. ->Path to Maven can also be found from /etc/bashrc file in mac. Get Path to Maven from that file and in that Maven directory you can find conf/ directory inside that directory you can find settings.xml of maven

Solution 6 - Macos

found it under /Users/username/apache-maven-3.3.9/conf

Solution 7 - Macos

I brew installed it, and found it under /usr/local/apache-maven-3.3.3/conf

Solution 8 - Macos

After I have downloaded the binary from apache site I, have placed the extracted folder in /Library
So now the location of the settings.xml file is in:

/Library/apache_maven_3.6.3/conf

Solution 9 - Macos

I installed mavaen using sdkman because of which the other proposed solution didn't work, as they are applicable if the installation is done via Homebrew or as a standalone binary.

for my solution I did "which mvn" in the terminal which returned: "/Users/samkaz/.sdkman/candidates/maven/current/bin/mvn"

Then after opening the path in a finder and looking around the above directory I found settings.xml in the below folder. "/Users/samkaz/.sdkman/candidates/maven/3.6.3/conf"

Solution 10 - Macos

For macOS Monterey 12.0.1 and home-brew 3.4.7, it locates at /opt/homebrew/Cellar/maven/{version}/libexec/

I got this location from mvn -version, which gives me

Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /opt/homebrew/Cellar/maven/3.8.5/libexec
Java version: 18, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk/18/libexec/openjdk.jdk/Contents/Home
Default locale: en_SG, platform encoding: UTF-8
OS name: "mac os x", version: "12.0.1", arch: "aarch64", family: "mac"

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestioncesarggfView Question on Stackoverflow
Solution 1 - MacosMengView Answer on Stackoverflow
Solution 2 - MacosColin HebertView Answer on Stackoverflow
Solution 3 - Macoswater_ak47View Answer on Stackoverflow
Solution 4 - Macosjulian0zzxView Answer on Stackoverflow
Solution 5 - MacoschaitanyaView Answer on Stackoverflow
Solution 6 - MacosChenView Answer on Stackoverflow
Solution 7 - Macosben26941View Answer on Stackoverflow
Solution 8 - Macosgregor vojvodaView Answer on Stackoverflow
Solution 9 - MacosSam KazView Answer on Stackoverflow
Solution 10 - MacoskunrenzhiluView Answer on Stackoverflow