1.在<localRepository>...</localRepository>标签内设置本地库的路径,也就是存jar包的本地位置,默认该标签是注掉的,可以手动添加。
2.在<mirrors>...</mirrors>标签内添加<mirror>...</mirror>标签并配置阿里云的镜像仓库,这里配的是public库。
3.<profiles>...</profiles>标签内添加<profile>...</profile>标签并配置适合自己的JDK版本。
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!--本地仓库位置 D:\software\maven-jar-ku-III-->
<localRepository>D:\software\maven-jar-ku-III</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
</servers>
<mirrors>
<!--阿里镜像 public库-->
<mirror>
<id>aliyun</id>
<name>aliyun for maven</name>
<mirrorOf>*</mirrorOf>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
</mirrors>
<profiles>
<!--配置适合自己的JDK -->
<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>
</profiles>
</settings>
4.
5.
6.
7.