1. 下载maven
Maven – Download Apache Mavenhttp://maven.apache.org/download.cgi
2. 解压到目标目录
3. 配置环境变量
- MAVEN_HOME
- path变量追加:
- %MAVEN_HOME%\bin
4. 修改仓库路径
<localRepository>D:\environment\apache-maven-3.6.3\repo</localRepository>
5. 配置阿里镜像
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
6. </profiles>设置编译JDK8
<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>