Maven在國內的話下載速度不夠快,推薦使用阿里雲的鏡像,配置方法還是比較簡單,下面是全局的配置文件 settings.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
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository />
<interactiveMode />
<usePluginRegistry />
<offline />
<pluginGroups />
<servers />
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
<proxies />
<profiles />
<activeProfiles />
</settings>
新建一個settings.xml的文件,將上述內容復制到該文件中,然后放置在個人目錄下的 /.m2 目錄下,使用maven下載包的時候就是從阿里雲下載了,速度會明顯快很多的。