window gradle configures local warehouse, accelerates and reuses local warehouse

1. Gradle’s default local warehouse

The default gradle warehouse location is:C:\Users\用户名\.gradle
Insert image description here

2. Window modifies the local warehouse

1. Create a new system variable:

GRADLE_USER_HOME
Insert image description here

2. Gradle Daemon configuration. Turning on this configuration can effectively improve the compilation speed.

Create a gradle.properties file in the gradle warehouse.gradle directory, then open the file and add the following statement to save it:
Insert image description here

org.gradle.daemon=true  

idea modification

Insert image description here

gradle acceleration

  • Enter the directory where gradle was decompressed. There is an init.d directory. In the directory, create a new init.gralde file.
    Insert image description here

  • Edit the init.gradle file and add the following content

allprojects {
    
    
    repositories {
    
    
        // 本地仓库,地址是maven本地仓库地址
        mavenLocal()
 
        // 阿里云仓库
        maven {
    
     url 'https://maven.aliyun.com/repository/central' }
        maven {
    
     url 'https://maven.aliyun.com/repository/google' }
        maven {
    
     url 'https://maven.aliyun.com/repository/gradle-plugin' }
        maven {
    
     url 'https://maven.aliyun.com/repository/jcenter' }
        maven {
    
     url 'https://maven.aliyun.com/repository/spring' }
        maven {
    
     url 'https://maven.aliyun.com/repository/spring-plugin' }
        maven {
    
     url 'https://maven.aliyun.com/repository/releases' }
        maven {
    
     url 'https://maven.aliyun.com/repository/spring-plugin' }
        maven {
    
     url 'https://maven.aliyun.com/repository/public' }
        maven {
    
     url 'https://maven.aliyun.com/repository/releases' }
        maven {
    
     url 'https://maven.aliyun.com/repository/grails-core' }
        maven {
    
     url 'https://maven.aliyun.com/repository/mapr-public' }
    }
}


Guess you like

Origin blog.csdn.net/qq_35385687/article/details/132826091