Maven阿里云镜像相信国内用得是很爽的,但有时候,一些版本的包明明可以在http://mvnrepository.com上搜索到。但你确实下载不来。。。

废话不多,settings.xml多镜像配置

nexus-aliyun

central

Nexus aliyun

http://maven.aliyun.com/nexus/content/groups/public

central-repository

*

Central Repository

http://central.maven.org/maven2/

以上的配置异常好用,亲测完美!

想知道缘由的朋友,敬请接着看下去。

虽然之前也是遇到这种Jar包下不来的情况,但是没有挣扎那么多,大不了就用低版本的。 但这次就不一样了,因为学习在elasticsearch,它对版本是绝对的敏感,各大版本号的API都有改动。 由于安装的是elasticsearch5.5.0,所以我在 http://mvnrepository.com/artifact/org.elasticsearch.client/transport/5.5.0 是找到了对应版本的

org.elasticsearch.client

transport

5.5.0

但是在pom中,傻眼了。。。

同样,对应5.5.0版本的spring-data-elasticsearch:3.0.0.RC2也是下不来

后来就想到会不会是阿里云镜像仓库的问题,几经周折,有了如下发现

让我们点击 Central 和 Spring Libs

可以看到上面收集的 Jars 数量,哈哈,这下子逆天了啊。

后来尝试了,配置如此最完美!