[gradle]设置默认用户名和密码

0x0001起因

项目里需要引用private的branch,但是密码又不能存储在代码里,如下:


repositories {
    google()
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
    maven {
        url 'https://raw.githubusercontent.com/xxx/sdk/master'
        credentials {
            username gitUser
            password gitPwd
        }
        authentication {
            basic(BasicAuthentication)
        }
    }
}

0x0002配置

PATH:

C:\Users\tom\.gradle

File Name:

gradle.properties

Settings:

gitUser="xxx"
gitPwd="xxx"

end

猜你喜欢

转载自blog.csdn.net/tomlucky1024/article/details/80898417