Mac中Java 配置maven及阿里雲映象
阿新 • • 發佈:2018-12-27
一:配置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>
|