一、下载
https://maven.apache.org/download.cgi
http://mirror.bit.edu.cn/apache/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.zip
二、配置
1、要求已经安装jdk1.7以上
2、配置maven环境变量
MAVEN_HOME
D:/apache-maven-3.5.3
path中添加
%MAVEN_HOME%/bin
3、配置国内镜像和本地仓库
修改配置文件D:\apache-maven-3.5.3\conf\settings.xml
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
添加本地仓库地址
<localRepository>E:/maven_repo</localRepository>
三、初始化
打开cmd,输入
mvn help:system
四、配置eclipse中的maven
window->Preferences->maven->installations->add,完成后勾选上
D:\apache-maven-3.5.3
window->Preferences->maven->user settings->user settings->browse...
D:\apache-maven-3.5.3\conf\settings.xml