1.下载地址
http://maven.apache.org/download.cgi
2.安装版本
3.安装步骤
下载完成,解压文件至D:\apache-maven-3.5.0
4.配置环境变量
4.1增加环境变量
变量名称:M2_HOME
变量值:D:\apache-maven-3.5.0
4.2增加PATH变量值
%M2_HOME%\bin
5.运行cmd,执行mvn -v命令
出现错误.
6.安装jdk1.8
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
7.再次运行cmd,执行mvn -v命令成功
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: D:\apache-maven-3.5.0\bin\..
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_131\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
8.修改maven配置文件
地址:D:\apache-maven-3.5.0\conf\settings.xml
增加:<localRepository>D:\maven\repository</localRepository>
9:实验下载文件
执行命令:mvn help:system