一:配置maven
1.下载maven,选择Binary tar.gz,解压拷贝到目录/usr/local/
1
|
https: //maven.apache.org/download.cgi
|
2.配置系统默认maven路径,打开配置文件
1
|
$ open ~/.bash_profile |
写入路径信息
1
2
|
export M2_HOME=/usr/local/apache-maven-3.3.9
export PATH=$PATH:$M2_HOME/bin
|
使之生效
1
|
$ source ~/.bash_profile |
3.检查:
1
|
输入mvn -v查看Maven是否安装成功 |
4.替换maven源,阿里云的源:
打开maven配置文件,比如:
1
|
$ open /usr/local/apache-maven-3.3.9/conf/settings.xml |
找到<mirrors></mirrors>标签对
添加后的效果为:
1
2
3
4
5
6
7
8
9
10
|
<mirrors> <mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http: //maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors> |