- Maven 配置多个镜像不生效
- 大数据开发的 Maven 配置
你可能试过,在 settings.xml 配置文件中配置多个镜像库来实现:依赖如果不在第一个镜像库,那么就去第二个镜像仓库下载,依次类推…
Maven – Guide to Mirror Settings (apache.org)
在上面的 Maven 文档中已经申明,只能配置最多一个镜像仓库,Maven 是实现不了你想要的需求的,你可能看到其它博客千篇一律介绍配置了多个镜像仓库,然后使用了相同的 mirrotOf ,这只能实现 如果第一个镜像仓库无法连接,那么就使用第二个镜像仓库!!!
在这种情况下,只能配置多个远程仓库来实现该需求
大数据开发的 Maven 配置默认使用 JDK1.8 为环境语言版本
使用阿里云的镜像仓库,如果阿里云镜像仓库无法连接就是用远程中心仓库
增加了大数据常用的远程仓库 CDH 和 JBOSS
/Users/kylewhite/dev/apache-repository false false alimaven central aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ repo2 central Human Readable Name for this Mirror. http://repo2.maven.org/maven2/ jdk8 true 1.8 1.8 1.8 1.8 UTF-8 cloudera cloudera_repo https://repository.cloudera.com/artifactory/cloudera-repos/ true true always jboss jboss_repo http://repository.jboss.com/nexus/content/groups/public true true always cloudera jboss



