在使用 Nexus 搭建自己的 Maven 仓库时,我们需要为一些公共的 Maven 仓库做镜像,这就需要这些仓库的真实地址了,下面是这些仓库的地址:
| 仓库名称 | 仓库地址 | gradle 引用方式 |
|---|---|---|
| jcenter | https://jcenter.bintray.com | jcenter() |
| mavenCentral | https://repo1.maven.org/maven2 或 http://central.maven.org/maven2/ (比较慢) | mavenCentral() |
| https://dl.google.com/dl/android/maven2/ | google() | |
| 阿里云 | http://maven.aliyun.com/nexus/content/repositories/jcenter/ 或 http://maven.aliyun.com/nexus/content/groups/public/ | maven {url ‘阿里地址’} |
windows: C:\Users\用户名\.gradle\caches\modules-2\files-2.1 OSX: /Users/用户名/.gradle/caches/modules-2/files-2.1
repositories { // maven库 def aliMaven = "http://maven.aliyun.com/nexus/content/groups/public/" def cMaven = "https://repo1.maven.org/maven2" // 先从url中下载jar若没有找到,则在artifactUrls中寻找 maven { url aliMaven artifactUrls cMaven } }
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/230064.html原文链接:https://javaforall.net
