Where is my m2 folder on Mac OS X Mavericks

I cannot find the local .m2 folder in Macware X mavericks. Ideally, this should be in {user.home}/.m2 , but I cannot find it.

Should I create it?

+23
maven-2 osx-mavericks
source share
7 answers

If you used brew to install maven, create the .m2 directory, and then copy the settings.xml file to the .m2 directory.

 mkdir ~/.m2 cp /usr/local/Cellar/maven32/3.2.5/libexec/conf/settings.xml ~/.m2 

You may need to change the version of maven along the way, my 3.2.5

+25
source share

At the top of the screen you can find the Finder. Click Go -> Go to Folder -> search ~/.m2

If it is not found, since m2 is a hidden file, you need to enable visibility by entering the following command in the terminal:

defaults write com.apple.finder AppleShowAllFiles YES

+16
source share

It is located in your home folder, but by default it is hidden.

Entering the following commands in the terminal made it visible to me (only the .m2 folder, and not all other hidden folders).

 > mv ~/.m2 ~/m2 > ln -s ~/m2 ~/.m2 

A source

+6
source share

By default, it will be hidden in your home directory. Type ls -a ~ to view this.

+4
source share

On a Mac, just run mvn clean install assuming maven is installed and it will automatically create .m2.

+3
source share

If you search directly, it is not displayed, so follow the instructions below to see the path to the .M2 repository.

 Go-> Find folder -> type this "~/.m2" and click go 

If Maven is already installed and in use, .m2 will be specified.

A source

+1
source share

You can try searching the local .m2 repository using the command in the project directory.

 mvn help:evaluate -Dexpression=settings.localRepository 

your output will be similar to below, and you can see the path to the local .m2 directory, as shown below: /Users/arai/.m2/repository

 Downloading from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar Downloaded from central: https://repo.maven.apache.org/maven2/net/sf/jtidy/jtidy/r938/jtidy-r938.jar (250 kB at 438 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.11/commons-codec-1.11.jar (335 kB at 530 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/org/jdom/jdom2/2.0.6/jdom2-2.0.6.jar (305 kB at 430 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar (500 kB at 595 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/com/thoughtworks/xstream/xstream/1.4.11.1/xstream-1.4.11.1.jar (621 kB at 671 kB/s) [INFO] No artifact parameter specified, using 'org.apache.maven:standalone-pom:pom:1' as project. [INFO] /Users/arai/.m2/repository [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.540 s [INFO] Finished at: 2019-01-23T13:57:54-05:00 [INFO] ------------------------------------------------------------------------ 
0
source share

All Articles