1.下载
- 下载地址:浏览器搜索maven进入官网(https://maven.apache.org/)
- Download(下载)>>>Binary zip archive apache-maven-3.9.1-bin.zip(版本选择)
2.配置环境变量
- 新建变量
高级系统设置>>>环境变量>>>新建(W)。
用户变量对当前用户有效,系统变量对所有用户有效。
变量名maven,变量值maven根目录。
- 添加路径
Path>>>编辑>>>新增“%maven变量名%\bin”>>>确定确定确定。
- 查看配置
win+R>>>cmd>>>输入命令
mvn -version
若正常显示maven版本号则环境变量配置成功。
3.idea配置maven
File>>>settings>>> 搜索maven(Build>>>Build Tools>>>maven)
-
修改maven家目录,即安装根目录。
-
选择settings文件,在conf文件下。
-
新建一个本地仓,选择本地仓。
-
修改settings文件本地仓地址,保存。
-
添加阿里云镜像.
settings文件里找到mirrors 标签,加入该镜像,保存。
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>