先去官網下載最新的maven版本
然后配置環境變量:新建兩個目錄:M2_HOME和MAVEN_HOME
在path中引入maven的bin目錄
設置本地倉庫:
在解壓后的文件中新建一個maven-repo文件夾
在setting.xml中配置倉庫位置
MAVEN的阿里雲鏡像
在<mirrors>中加入下面這段代碼
1 <mirror> 2 <id>alimaven</id> 3 <mirrorOf>central</mirrorOf> 4 <name>aliyun maven</name> 5 <url>http://maven.aliyun.com/nexus/content/repositories/central/</url> 6 </mirror>
配置jdk:要夾在兩個profiles標簽之間,這里用的是1.8
1 <!-- java版本 --> 2 <profile> 3 <id>jdk-1.8</id> 4 <activation> 5 <activeByDefault>true</activeByDefault> 6 <jdk>1.8</jdk> 7 </activation> 8 9 <properties> 10 <maven.compiler.source>1.8</maven.compiler.source> 11 <maven.compiler.target>1.8</maven.compiler.target> 12 <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> 13 </properties> 14 </profile>