在init.gradle使用阿里云gradle-plugin代替plugins.gradle.org
本人已在gradle 3.3下测试可用,使用3.3版本主要是调试elasticsearch 5.5用的。
init.gradle
allprojects{ repositories { def ALIYUN_REPOSITORY_URL = 'https://maven.aliyun.com/repository/central/' def ALIYUN_JCENTER_URL = 'https://maven.aliyun.com/repository/jcenter/' all { ArtifactRepository repo -> if(repo instanceof MavenArtifactRepository){ def url = repo.url.toString() if (url.startsWith('https://repo1.maven.org/maven2/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL." remove repo } if (url.startsWith('https://jcenter.bintray.com/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL." remove repo } } } maven { url ALIYUN_REPOSITORY_URL } maven { url ALIYUN_JCENTER_URL } } buildscript { repositories { def ALIYUN_GRADLE_PLUGIN_URL = 'https://maven.aliyun.com/repository/gradle-plugin/' all { ArtifactRepository repo -> if(repo instanceof MavenArtifactRepository){ def url = repo.url.toString() if (url.startsWith('https://plugins.gradle.org/m2/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_GRADLE_PLUGIN_URL." remove repo } } } maven { url ALIYUN_GRADLE_PLUGIN_URL } } } }
output:
<省略...>
Repository https://plugins.gradle.org/m2/ replaced by https://maven.aliyun.com/repository/gradle-plugin/. Download https://maven.aliyun.com/repository/gradle-plugin/com/github/jengelman/gradle/plugins/shadow/1.2.3/shadow-1.2.3.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/jdom/jdom2/2.0.5/jdom2-2.0.5.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/ow2/asm/asm/5.0.3/asm-5.0.3.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/ow2/asm/asm-parent/5.0.3/asm-parent-5.0.3.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/ow2/ow2/1.3/ow2-1.3.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/apache/ant/ant/1.9.4/ant-1.9.4.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/apache/ant/ant-parent/1.9.4/ant-parent-1.9.4.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/codehaus/plexus/plexus-utils/2.0.6/plexus-utils-2.0.6.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/codehaus/groovy/groovy-backports-compat23/2.4.4/groovy-backports-compat23-2.4.4.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.pom Download https://maven.aliyun.com/repository/gradle-plugin/org/apache/ant/ant-launcher/1.9.4/ant-launcher-1.9.4.pom Download https://maven.aliyun.com/repository/gradle-plugin/com/github/jengelman/gradle/plugins/shadow/1.2.3/shadow-1.2.3.jar Download https://maven.aliyun.com/repository/gradle-plugin/org/jdom/jdom2/2.0.5/jdom2-2.0.5.jar
Download https://maven.aliyun.com/repository/gradle-plugin/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar
<省略...>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
2011-04-10 VS2010安装EFCodeFirst后无法显示ADO.NET DbContext Generator项目的解决方案