Skip to main content

Gradle优化技巧

huhxLess than 1 minuteTips

maven credential的配置

repositories {
    maven {
        url 'https://host.hostxxxx/repository/maven-public/'
        credentials {
            username "$mavenUser"
            password "$mavenPassword"
        }
    }
}

这个时候需要定义Gradle的配置,创建gradle.properties文件。在Gradle中属性加载的顺序如下

1. command line, set using -D.
  
2. gradle.properties in GRADLE_USER_HOME directory. 

3. gradle.properties in the project’s directory, then its parent project’s directory up to the build’s root directory.

4. gradle.properties in the Gradle installation directory.

安装gradlew

gradle wrapper