开始

使用本地Gradle

  1. 修改gradle/wrapper/gradle-wrapper.properties内容中distributionUrl为本地安装目录

    1. distributionBase=GRADLE_USER_HOME
    2. distributionPath=wrapper/dists
    3. distributionUrl=/usr/local/env/gradle-6.7.1
    4. zipStoreBase=GRADLE_USER_HOME
    5. zipStorePath=wrapper/dists
  2. 修改Use Gradle Form 为本地安装目录

    仓库配置

    ```java repositories { mavenLocal() mavenCentral() maven { url ‘https://maven.aliyun.com/repository/public/‘ } maven { url ‘http://maven.aliyun.com/repository/public/‘ allowInsecureProtocol = true //http需要 } }

spring boot

plugins { id ‘org.springframework.boot’ version ‘2.3.2.RELEASE’ id ‘io.spring.dependency-management’ version ‘1.0.9.RELEASE’ id ‘java’ }

打包 jar在build/libs目录下

gradle bootjar OR gradle clean bootjar ```

常用私有库

仓库名称 阿里云仓库地址 源地址
central https://maven.aliyun.com/repository/central https://repo1.maven.org/maven2/
jcenter https://maven.aliyun.com/repository/public http://jcenter.bintray.com/
public https://maven.aliyun.com/repository/public central仓和jcenter仓的聚合仓
google https://maven.aliyun.com/repository/google https://maven.google.com/
gradle-plugin https://maven.aliyun.com/repository/gradle-plugin https://plugins.gradle.org/m2/
spring https://maven.aliyun.com/repository/spring http://repo.spring.io/libs-milestone/
spring-plugin https://maven.aliyun.com/repository/spring-plugin http://repo.spring.io/plugins-release/
grails-core https://maven.aliyun.com/repository/grails-core https://repo.grails.org/grails/core
apache snapshots https://maven.aliyun.com/repository/apache-snapshots https://repository.apache.org/snapshots/