1、下载maven
地址http://maven.apache.org/download.cgi
打开(bash_profile)终端输入open -e .bash_profile
添加maven路径
export MAVEN_HOME=~/Library/环境配置/apache-maven-3.3.9
export PATH=$MAVEN_HOME/bin:$PATH
执行 终端输入source .bash_profile
4、设置maven repository
地址http://maven.apache.org/download.cgi
2、解压设置maven本地地址解压后
我放在~/Library/环境配置/目录下
3、配置环境。编辑profile文件,并添加maven路径打开(bash_profile)终端输入open -e .bash_profile
添加maven路径
export MAVEN_HOME=~/Library/环境配置/apache-maven-3.3.9
export PATH=$MAVEN_HOME/bin:$PATH
执行 终端输入source .bash_profile
4、设置maven repository
在maven安装目录下的conf里面有个settings.xml,搜索(localRepository),设置自己的repo(红色方框为新添加的自定义maven repository绝对路径)
参考地址;http://www.jianshu.com/p/43f0f2d0e966