-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathinit.gradle
More file actions
35 lines (34 loc) · 1.41 KB
/
init.gradle
File metadata and controls
35 lines (34 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Gradle 初始化脚本 - 配置 Maven 镜像加速
allprojects {
repositories {
all { ArtifactRepository repo ->
if (repo instanceof MavenArtifactRepository) {
def url = repo.url.toString()
if (url.startsWith('https://repo1.maven.org/maven2') ||
url.startsWith('https://repo.maven.apache.org/maven2')) {
project.logger.lifecycle "Repository ${repo.url} replaced by Aliyun mirror."
remove repo
}
}
}
// 使用阿里云镜像
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/central' }
}
buildscript {
repositories {
all { ArtifactRepository repo ->
if (repo instanceof MavenArtifactRepository) {
def url = repo.url.toString()
if (url.startsWith('https://repo1.maven.org/maven2') ||
url.startsWith('https://repo.maven.apache.org/maven2')) {
project.logger.lifecycle "Repository ${repo.url} replaced by Aliyun mirror."
remove repo
}
}
}
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/central' }
}
}
}