- brew search maven
- brew info maven
- brew install maven
验证maven是否安装成功
mvn -version
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_131, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.5", arch: "x86_64", family: "mac"
配置maven仓库
在路径/usr/local/Cellar/maven/3.5.0/libexec/conf下找到setting.xml,设置
<localRepository>/Users/xxx/maven_repo</localRepository>