1. Download maven:http://maven.apache.org/download.cgi
2, the download to the compressed package to the appropriate directory, the local directory structure is/users/jiangzhiqiang/local/apache-maven-3.2.53, and then configure the environment variables. See if there is a. bash_profile file under ~/, and if not, create an environment variable to configure in this file. Create File: Shell code
- Touch ~/.bash_profile
Edit Bash_profile File: Shell code
- VI ~/.bash_profile
Configure the following four environment variables:
Shell Code
- # The directory where MAVEN resides
- Export m2_home=/users/jiangzhiqiang/local/apache-maven-3.2. 5
- # The directory where Maven bin resides
- Export m2= $M 2_home/bin
- # Add the Maven bin to the PATH variable
- Export path= $M 2: $PATH
- # Configure the directory where the Java_home is located, note that there should be a bin folder under this directory, there should be Java and other commands under the bin
- Export JAVA_HOME=/LIBRARY/JAVA/JAVAVIRTUALMACHINES/JDK1. 7.0_71.jdk/contents/home
3. Execute force command shell code in terminal
- SOURCE ~/.bash_profile
4, in the New command line window to execute mvn-v, if the normal display of the MAVEN version and other information, is the configuration is successful. quote:http://blog.csdn.net/shijiedemuguang/article/details/38865331
MAVEN Configuration under Mac