安裝包下載:http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3
或者
http://maven.apache.org/download.cgi
選在自己需要安裝的版本;
【安裝步驟】
1、下載解壓到指定目錄:D:\install
2、環境變量配置:
a、變量:M2_HOME,變量值:D:\install\apache-maven-3.5.3
b、變量:Path,變量值:%M2_HOME%\bin
檢查安裝配置是否成功
打開CMD窗口,顯示如下信息即安裝配置成功。
3、修改本地倉庫位置
文件位置:D:\install\apache-maven-3.5.3\conf\settings.xml
在<settings></settings>標簽對中加入以下內容
<localRepository>D:\install\repo</localRepository>
4、配置阿里雲的中央倉庫
文件位置:D:\install\apache-maven-3.5.3\conf\settings.xml
在上述文件中的 <mirrors></mirrors>標簽對中加入以下內容
<mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror>
5、修改IDE的maven配置(Myeclispe為例)
菜單欄 Windows —> Preferences —> Maven —> User Settings