The first blogger is also in the introductory study, in learning Maven encountered a lot of problems. Check the data found that the use of online maven is mostly win, so I am going to write some maven in the introduction of Mac notes, hope to help you as I have difficulties.
1, http://maven.apache.org/download.html
First go to the official website to download the latest version of Maven, such as apache-maven-3.3.3-bin.tar.gz, and then extract to the local directory (/usr/local/).
2. Next, we need to set the M2_HOME environment variable to point to apache-maven-3.3.3, and add the bin/folder under the MAVEN installation directory to the System environment variable path (prior to configuring the Java_home):
Vim opens the/etc/profile file by adding the following code:
Export m2_home=/users/wanyakun/documents/apache-maven-3.3.3
Export path= $PATH: $M 2_home/bin
The installation was done to this rescue.
3. Let's check if the installation is successful.
Mvn-version
localhost:~ nwl$ mvn-version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22t19:57:37+08:00)
Maven Home:/usr/local/apache-maven-3.3.3
Java version:1.7.0_79, Vendor:oracle Corporation
Java Home:/library/java/javavirtualmachines/jdk1.7.0_79.jdk/contents/home/jre
Default LOCALE:ZH_CN, Platform Encoding:utf-8
OS name: "Mac OS X", Version: "10.10.5", Arch: "X86_64", Family: "Mac"
Now let's talk about Maven's use:
4. Create a project
Switch to the root directory of the MAVEN project (not the installation directory). CD /users/nwl/documents/apache-maven-3.3.3.
MVN Archetype:create-dgroupid=edu.zju.cst.myproject-dartifactid=repo (the first compilation will take a long time, please wait patiently).
Getting started with Maven on a Mac