一.安装
maven运行依赖于 JAVA_HOME,首先确保你的系统安装了jdk。
下载并解压 maven压缩包
官方下载地址为:http://maven.apache.org/download.cgi
二.配置环境变量
配置系统环境变量 MAVEN_HOME 和 path
MAVEN_HOME:maven解压后的路径
三.修改远程仓库地址为阿里云
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- 本地仓库地址 -->
<localRepository>D:\repository4</localRepository>
<!-- 远程仓库镜像设置成阿里云-->
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
<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>
</settings>