快速解决 GRADLE 项目下载 gradle-*-all.zip 慢的问题

 

 

一、首先根据项目中 gradle\wrapper\gradle-wrapper.properties 文件的 distributionUrl 属性的值html

#Tue Feb 06 12:27:20 CET 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip

 

二、根据  distributionUrl  对应的 gradle 的版本好,去下载相应的版本,能够经过 迅雷 或者其余国内网站下载,下载后先保存在本地,等待后续使用linux

三、运行 gradle build 命令进行构建spring

# Windows 下使用 gradlew.bat build # Linux mac 下使用 gradlew build

运行之后,提示下载时,终止掉app

 

终止掉后,打开此文件夹 $GRADLE_USER_HOME/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn maven

橙色字体可能会和我不同,无所谓spring-boot

提示:这个文件夹大多数都在用户主目录下 .gradle//wrapper/dists/... 下工具

四、在进入上一步说的文件夹之后先删除全部文件,而后把第二步下载好的 zip 文件复制到此文件夹下 $GRADLE_USER_HOME/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn 。字体

五、再次执行 gradle build (注意 Windows 和 linux的命令不一样),会变成以下,不须要再下载这个文件了,编译会很快经过gradle

C:\Users\duwenlei\IdeaProjects\spring_boot_demo λ gradlew.bat build Unzipping C:\Users\duwenlei\.gradle\wrapper\dists\gradle-4.8.1-bin\e8p42vx1m7a3mz9ydmjagn6wn\gradle-4.8.1-bin.zip to C:\Users\duwenlei\.gradle\wrapper\dists\gradle-4.8.1-bin\e8p42vx1m7a3mz9ydmjagn6wn Welcome to Gradle 4.8.1! Here are the highlights of this release: - Dependency locking - Maven Publish and Ivy Publish plugins improved and marked stable - Incremental annotation processing enhancements - APIs to configure tasks at creation time For more details see https://docs.gradle.org/4.8.1/release-notes.html
 Starting a Gradle Daemon (subsequent builds will be faster) ... Download http://maven.aliyun.com/nexus/content/repositories/central/org/springframework/boot/spring-boot-starter-test/2.0.6.RELEASE/spring-boot-starter-test-2.0.6.RELEASE.jar

> Task :test 2018-10-25 23:34:55.551  INFO 588 --- [       Thread-5] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@413698fe: startup date [Thu Oct 25 23:34:52 CST 2018]; root of context hierarchy BUILD SUCCESSFUL in 1m 5s 5 actionable tasks: 5 executed

 

六、完结,能够在经过 IDEA 或者其余编码工具打开工程,跳过了慢悠悠的下载过程。网站

相关文章
相关标签/搜索