我在artifactory的虚拟仓库加入了阿里云中央仓库,为什么还是从bintray下载的依赖呢?

来源:5-2 搭建Maven私服

他门说这就是人生

2020-08-20

如图,我从artifactory的虚拟仓库加入了阿里云中央仓库:

http://img.mukewang.com/szimg/5f3dc79b09afbfb519200974.jpg

远程仓库配置如下:

http://img1.sycdn.imooc.com/szimg/5f3dc7c809a1747919200970.jpg

可看docker日志,依赖还是从jcenter的远程仓库下载的,请老师帮我分析一下可能的原因,docker日志如下:

2020-08-19 10:22:17,413 [http-nio-8081-exec-7] [INFO ] (o.a.r.HttpRepo      :420) - jcenter downloading https://jcenter.bintray.com/org/hibernate/common/hibernate-commons-annotations/5.0.4.Final/hibernate-commons-annotations-5.0.4.Final.pom 1.88 KB 
2020-08-19 10:22:17,460 [http-nio-8081-exec-7] [INFO ] (o.a.r.HttpRepo      :433) - jcenter downloaded  https://jcenter.bintray.com/org/hibernate/common/hibernate-commons-annotations/5.0.4.Final/hibernate-commons-annotations-5.0.4.Final.pom 1.88 KB at 41.39 KB/sec
2020-08-19 10:22:18,130 [http-nio-8081-exec-4] [INFO ] (o.a.r.HttpRepo      :420) - jcenter downloading https://jcenter.bintray.com/org/springframework/data/spring-data-jpa/2.1.6.RELEASE/spring-data-jpa-2.1.6.RELEASE.pom 12.68 KB 
2020-08-19 10:22:18,611 [http-nio-8081-exec-4] [INFO ] (o.a.r.HttpRepo      :433) - jcenter downloaded  https://jcenter.bintray.com/org/springframework/data/spring-data-jpa/2.1.6.RELEASE/spring-data-jpa-2.1.6.RELEASE.pom 12.68 KB at 26.51 KB/sec
2020-08-19 10:22:19,272 [http-nio-8081-exec-1] [INFO ] (o.a.r.HttpRepo      :420) - jcenter downloading https://jcenter.bintray.com/org/springframework/data/build/spring-data-parent/2.1.6.RELEASE/spring-data-parent-2.1.6.RELEASE.pom 28.69 KB 
2020-08-19 10:22:19,991 [http-nio-8081-exec-1] [INFO ] (o.a.r.HttpRepo      :433) - jcenter downloaded  https://jcenter.bintray.com/org/springframework/data/build/spring-data-parent/2.1.6.RELEASE/spring-data-parent-2.1.6.RELEASE.pom 28.69 KB at 39.93 KB/sec
2020-08-19 10:22:20,970 [http-nio-8081-exec-8] [INFO ] (o.a.r.HttpRepo      :420) - jcenter downloading https://jcenter.bintray.com/org/springframework/data/spring-data-commons/2.1.6.RELEASE/spring-data-commons-2.1.6.RELEASE.pom 9.73 KB 
2020-08-19 10:22:21,003 [http-nio-8081-exec-8] [INFO ] (o.a.r.HttpRepo      :433) - jcenter downloaded  https://jcenter.bintray.com/org/springframework/data/spring-data-commons/2.1.6.RELEASE/spring-data-commons-2.1.6.RELEASE.pom 9.73 KB at 305.51 KB/sec
2020-08-19 10:22:21,906 [http-nio-8081-exec-9] [INFO ] (o.a.r.HttpRepo      :420) - jcenter downloading https://jcenter.bintray.com/org/springframework/spring-orm/5.1.6.RELEASE/spring-orm-5.1.6.RELEASE.pom 3.54 KB 
2020-08-19 10:22:21,940 [http-nio-8081-exec-9] [INFO ] (o.a.r.HttpRepo      :433) - jcenter downloaded  https://jcenter.bintray.com/org/springframework/spring-orm/5.1.6.RELEASE/spring-orm-5.1.6.RELEASE.pom 3.54 KB at 108.66 KB/sec

ps(2020-08-21):

我把jcenter去掉就会变得一个依赖也下载不了:

http://img.mukewang.com/szimg/5f3f1e940990b9fa19201048.jpg

配置见下图:

http://img1.sycdn.imooc.com/szimg/5f3f1eac0907863e19200973.jpg

http://img.mukewang.com/szimg/5f3f1ec4097ebaf519200970.jpg

是不是jcenter-aliyun的地址有问题?老师帮我看看吧,谢谢。

写回答

2回答

清风

2020-08-21

你的截图我看不太清楚,如果去掉 jcenter 的远程仓库就下载不了包,说明 JCenter 远程仓库生效了,而阿里云的远程仓库没有生效。

建议:可以试试这个远程仓库地址:http://mirrors.aliyuncs.com,或者https://maven.aliyun.com/repository/central

0
2
清风
对,它屏蔽了页面访问,但不影响maven 客户端请求
2020-08-21
共2条回复

清风

2020-08-20

可能是阿里云没有这个包,才会去下一个仓库jcenter 去找。你试试把jcenter 远程仓库从虚拟仓库里去掉,看看什么效果

0
1
他门说这就是人生
见ps(2020-08-21),我把jcenter去掉就会变得一个依赖也下载不了。是不是jcenter-aliyun的地址有问题?老师帮我看看阿里云的远程仓库应该怎样在artifactory里填写吧,谢谢。
2020-08-21
共1条回复

SpringCloud+Kubernetes 微服务容器化交付实战

学习业界领先的持续交付方案

661 学习 · 109 问题

查看课程