gradle编译spring
配置gralde
调整gradle的仓库使用阿里镜像,在.gradle下创建init.gradle,并输入以下内容:
allprojects {
repositories {
maven {
url 'https://maven.aliyun.com/repository/public/'
}
maven {
url 'https://maven.aliyun.com/repository/google/'
}
all { ArtifactRepository repo ->
if (repo instanceof MavenArtifactRepository) {
def url = repo.url.toString()
if (url.startsWith('https://repo.maven.apache.org/maven2/') || url.startsWith('https://repo.maven.org/maven2')
|| url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')
|| url.startsWith('https://maven.google.com/') || url.startsWith('https://dl.google.com/dl/android/maven2/')) {
//project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
remove repo
}
}
}
}
buildscript {
repositories {
maven{ url 'https://maven.aliyun.com/repository/public/'}
maven{ url 'https://maven.aliyun.com/repository/google/'}
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/')
|| url.startsWith('https://dl.google.com/dl/android/maven2/')) {
//project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
remove repo
}
}
}
}
}
}
,然后进行编译即可,无需修改spring项目中的配置。
本文地址:https://blog.csdn.net/yz7074998/article/details/107171269
上一篇: 拼多多“双11”再次下调iPhone 11售价 最高降幅达1600元
下一篇: 这车不会是偷来的吧?