AndroidStudio使用Maven私服二:在gradle中引入Maven私服

在工程的根工程的 build.gradle中,添加如下代码

//        引入Maven私服
        maven {
            url 'http://Nenus私服地址/repository/lj_releases/'
            credentials {
                username 'admin'
                password 'admin123'
            }
        }
        maven {
            url 'http://Nenus私服地址/repository/lj_snapshot/'
            credentials {
                username 'admin'
                password 'admin123'
            }
        }

整个文件代码

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
//        引入Maven私服
        maven {
            url 'http://Nenus私服地址/repository/lj_releases/'
            credentials {
                username 'admin'
                password 'admin123'
            }
        }
        maven {
            url 'http://Nenus私服地址/repository/lj_snapshot/'
            credentials {
                username 'admin'
                password 'admin123'
            }
        }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        //        引入Maven私服
        maven {
            url 'http://Nenus私服地址/repository/lj_releases/'
            credentials {
                username 'admin'
                password 'admin123'
            }
        }
        maven {
            url 'http://Nenus私服地址/repository/lj_snapshot/'
            credentials {
                username 'admin'
                password 'admin123'
            }
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

你可能感兴趣的:(maven)