Maven 国内镜像配置:settings.xml、mirror 与私服排错
· 阅读需 1 分钟
国内最好的maven repository
仓库地址的可用性会随时间变化,复制配置前应先验证 HTTPS、证书和组织策略。团队项目更适合使用 Nexus 或 Artifactory 等私服统一代理外部仓库。
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
修改setting.xml
在</mirrors>前添加上面的那段代码即可
如果是在project中使用
在</project>之前加上下面的代码就可以使用了
<repositories>
<repository>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>