MAC 配置Maven
系统macOS Mojave 10.14.2
maven版本 3.6.0
1、先去下载Maven :
http://maven.apache.org/download.cgi 找到 apache-maven-3.6.0-bin.tar.gz 并解压
2、配置环境
打开终端先输入 :
vim ~/.bash_profile
后输入
i
再输入
export M2_HOME=/xxxxx/apache-maven-3.6.0
export PATH=$PATH:$M2_HOME/bin
xxxxx就是刚才解压的Maven路径
再按键盘 esc 输入
:wq
再执行
source ~/.bash_profile
3、查看配置是否生效
mvn -v
出现以下就是OK了
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T02:41:47+08:00)
Maven home: /Users/liuwuwen/javaMaven/apache-maven-3.6.0
Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.2", arch: "x86_64", family: "mac"