maven安装配置
https://maven.apache.org/download.cgi
maven官网
windows下载zip,linux自己知道下载什么格式
解压
然后新建系统变量MAVEN_HOME并且配置为刚才解压出来的文件路径
在系统变量path中添加 ;%MAVEN_HOME%\bin
然后验证是否配置成功 在命令行窗口 mvn -version
然后还要修改配置,打开在maven解压的路径的config文件夹下的setting
大约在55行(注释外)写入<localRepository>xxx(用来保存仓库文件的路径,注意是反斜杠)</localRepository>
大约在150行(标签mirrors)中添加阿里云仓库(为了下载更快)
<!-- 阿里云仓库 -->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
在大约192行的位置(标签profiles中)添加java版本,根据自己的版本,我的是jdk1.8
<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>
配置完,测试下 命令行输入mvn help:system