持续集成:Maven 中央仓库的替代方案

My GitHub Home Page

新搭建的私服库,其 maven-central 的默认地址为 Maven 中央仓库 (https://repo1.maven.org/maven2/) ,这个地址在国内非常不稳定,经常 TIME OUT 。

镜像替代

Maven 中央仓库:

  • 华为:https://mirrors.huaweicloud.com/repository/maven
  • 阿里云:https://maven.aliyun.com/repository/central
  • Spring:https://repo.spring.io/libs-release
  • JitPack:https://jitpack.io
  • JCenter:https://jcenter.bintray.com

仅 Spring :

  • Spring Release:https://repo.spring.io/release
  • Spring Milestone:https://repo.spring.io/milestone
  • Spring Snapshots:https://repo.spring.io/snapshot

配置方式

以下四种方式均可:

  • 项目 pom 文件中指定私服 url
  • Maven settings.xml 中 url
  • Nexus 中修改 maven-central 的 url
  • Nexus 中新增 proxy repository ,并加入 maven-public group ,排在 maven-central 前面

推荐最后一种。