下载完成后,需要配置如下几项:
1、maven_home,本地maven安装路径目录下;
2、path,%maven_home%\bin
3、配置setting.xml,中央仓库,启用镜像阿里云,
<!-- 阿里云仓库 -->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
同时设置JDK,本次使用的是JDK18
<profile>
<id>myjdk</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>18</jdk>
</activation>
<properties>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
<maven.compiler.compilerVersion>18</maven.compiler.compilerVersion>
</properties>
</profile>
4、配置完成后,mvn help:system,进行测试。