1.运行时环境
电脑上已经安装jdk,且已经配置好JAVA_HOME环境变量
2.安装maven核心程序
eg: appache-maven-3.2.2
2.1、配置maven环境变量:MAVEN_HOME或M2_HOME
xxxx/xxxx/appache-maven-3.2.2
2.2、path
xxxx/xxxx/appache-maven-3.2.2/bin
2.3、mvn -v验证
3.eclipse中配置maven路径
设置settings.xml路径:settings.xml可指定本地仓库位置等信息
4.idea中配置maven
file-->settings:
配置本地仓库和配置文件:
5、settings.xml配置
5.1.阿里云镜像
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
5.2.本地仓库
<localRepository>D:\Respository</localRepository>
5.3.jdk配置
<profiles>
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>