2023年,Gradle环境安装配置
windows10安装Gradle
ps →_→ 点点我下载:
配置全局下载源URL
ps:在该目录下创建文件 init.gradle
init.gradle 填写
allprojects{
repositories {
def REPOSITORY_URL = 'https://maven.aliyun.com/nexus/content/groups/public/'
all { ArtifactRepository repo ->
if(repo instanceof MavenArtifactRepository){
def url = repo.url.toString()
if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
remove repo
}
}
}
maven {
url REPOSITORY_URL
}
}
}
note: maven { url "https://maven.aliyun.com/repository/public/" }
(可选)配置代理
配置HTTPS\s代理
systemProp.https.proxyHost=www.example.org
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=userid
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=*.example.com|localhost