1、打開maven存放文件夾找到 conf ->settings.xml

找到<mirrors>節點
把下面內容寫入節點內 配置為阿里雲的鏡像
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
還有些其他可用鏡像
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
<mirror>
<id>ui</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://uk.maven.org/maven2/</url>
</mirror>
2、maven下載文件默認存放在c盤,可以配置放在別的磁盤
還是settings.xml文件 找到 <localRepository> 復制出來並修改地址

(1)為默認存放路徑
(2)為改后存放路徑
2、idea中配置maven
File->Settings 配置如下

