全局配置
修改settting文件
在mirrors標簽下添加子節點。
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
< mirrorOf>可以設置為指定中央倉庫做鏡像。
< mirrorOf>central< /mirrorOf> 為名為“central”的中央倉庫做鏡像; < mirrorOf>*< /mirrorOf> 為所有中央倉庫做鏡像。
Maven默認中央倉庫的id 為 central。id是唯一的。
單項目配置,修改pom文件
<repositories>
<repository>
<id>central</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<layout>default</layout>
<!-- 是否開啟發布版構件下載 -->
<releases>
<enabled>true</enabled>
</releases>
<!-- 是否開啟快照版構件下載 -->
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
