官网下载maven
https://maven.apache.org/download.cgi
解压并进入conf
双击setting.xml
将maven中央仓库改为阿里云的,在mirrors节点下添加如下代码1
2
3
4
5
6<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
将jdk版本改为1.8,在profiles节点下添加如下代码1
2
3
4
5
6
7
8
9
10
11
12<profile>
<id>jdk18</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>
配置eclipse
找到以下目录
Window->Preferences->maven->User Settings
将User Settings的路径更改为刚刚配置的setting.xml的路径