1.添加阿里云的镜像,在apache-maven-3.5.0\conf\setting.xml,添加如下代码:
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
2.创建一个本地库MyRepository
在setting.xml引入本地库路径
<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">
<localRepository>D:\maven\MyRepository</localRepository>
3.idea添加镜像
如果出现jar包无法下载或者下载jar包报错,不妨试试执行 mvn help:system