1. First, according to the distributionurl attribute value of the gradle \ wrapper \ gradle-wrapper.properties file in the project
#Tue Feb 06 12:27:20 CET 2018distributionBase=GRADLE_USER_HOMEdistributionPath=wrapper/distszipStoreBase=GRADLE_USER_HOMEzipStorePath=wrapper/distsdistributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
2. Download the corresponding gradle version based on the distributionurl. You can download it from thunder or other Chinese websites. Download it and save it locally for later use.
3. Run the gradle build command to build
# Use gradlew. Bat build in Windows # Use gradlew build in Linux Mac
After running, the download is aborted
Open this folder $ gradle_user_home/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjarn6wn after termination
The orange font may be different from me. It doesn't matter.
Tip: Most of the folders are in the. gradle // wrapper/dists/... directory of the user's main directory.
4. delete all the files after entering the folder mentioned in the previous step, and then copy the ZIP file downloaded in step 2 to the folder $ gradle_user_home/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjarn6wn.
5. Execute gradle build again (note that the commands for Windows and Linux are different) and the file will be changed to the following. You do not need to download this file again, and the compilation will soon pass
C:\Users\duwenlei\IdeaProjects\spring_boot_demoλ gradlew.bat buildUnzipping 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\e8p42vx1m7a3mz9ydmjagn6wnWelcome 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 timeFor more details see https://docs.gradle.org/4.8.1/release-notes.htmlStarting 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 :test2018-10-25 23:34:55.551 INFO 588 --- [ Thread-5] s.c.a.AnnotationConfigApplicationContext : Closing org.spring[email protected]413698fe: startup date [Thu Oct 25 23:34:52 CST 2018]; root of context hierarchyBUILD SUCCESSFUL in 1m 5s5 actionable tasks: 5 executed
6. You can open the project through idea or other coding tools to skip the slow download process.
Quickly solve the problem of downloading gradle-* -all.zip from the gradle Project