1、从官网(https://maven.apache.org/download.cgi)下载 Maven 并解压。
2、配置环境
. vim ~/.bash_profile
export MAVEN_HOME=/Users/nicknailo/Documents/apache-maven-3.5.3 export MONGODB_HOME=/Users/nicknailo/Documents/mongodb export PATH=${PATH}:${MAVEN_HOME}/bin:$MONGODB_HOME/bin
source ~/.bash_profile
3、验证安装
nicknailodeMacBook-Pro:~ nicknailo$ mvn -v Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00) Maven home: /Users/nicknailo/Documents/apache-maven-3.5.3 Java version: 1.8.0_161, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "mac os x", version: "10.13.3", arch: "x86_64", family: "mac"