android配置阿里云maven仓库

每次开发android 都得面临各种依赖下载失败的问题,每次都得去网上搜各种仓库地址,这里记录一下,省的找不着。在项目根目录下build.gradle中配置的代码如下:

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

buildscript {

    repositories {

        maven { url 'https://maven.aliyun.com/repository/central' }

        maven { url 'https://maven.aliyun.com/repository/jcenter' }

        maven { url 'https://maven.aliyun.com/repository/google' }

        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }

        maven { url 'https://maven.aliyun.com/repository/public' }

        maven { url 'https://jitpack.io' }

        google()

        jcenter()

    }

    dependencies {

        classpath "com.android.tools.build:gradle:4.1.1"

        // NOTE: Do not place your application dependencies here; they belong

        // in the individual module build.gradle files

    }

}

allprojects {

    repositories {

        maven { url 'https://maven.aliyun.com/repository/central' }

        maven { url 'https://maven.aliyun.com/repository/jcenter' }

        maven { url 'https://maven.aliyun.com/repository/google' }

        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }

        maven { url 'https://maven.aliyun.com/repository/public' }

        maven { url 'https://mapbox.bintray.com/mapbox' }

        maven { url 'https://jitpack.io' }

        maven {

//            专为Mapbox配置

            url 'https://api.mapbox.com/downloads/v2/releases/maven'

            authentication {

                basic(BasicAuthentication)

            }

            credentials {

                // Do not change the username below.

                // This should always be `mapbox` (not your username).

                username = 'mapbox'

                // Use the secret token you stored in gradle.properties as the password

                password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""

            }

        }

        google()

        jcenter()

    }

}

task clean(type: Delete) {

    delete rootProject.buildDir

}

————————————————

版权声明:本文为CSDN博主「GIS开发者」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/GISuuser/article/details/116945924

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

buildscript {

    repositories {

        maven { url 'https://maven.aliyun.com/repository/central' }

        maven { url 'https://maven.aliyun.com/repository/jcenter' }

        maven { url 'https://maven.aliyun.com/repository/google' }

        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }

        maven { url 'https://maven.aliyun.com/repository/public' }

        maven { url 'https://jitpack.io' }

        google()

        jcenter()

    }

    dependencies {

        classpath "com.android.tools.build:gradle:4.1.1"

        // NOTE: Do not place your application dependencies here; they belong

        // in the individual module build.gradle files

    }

}

allprojects {

    repositories {

        maven { url 'https://maven.aliyun.com/repository/central' }

        maven { url 'https://maven.aliyun.com/repository/jcenter' }

        maven { url 'https://maven.aliyun.com/repository/google' }

        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }

        maven { url 'https://maven.aliyun.com/repository/public' }

        maven { url 'https://mapbox.bintray.com/mapbox' }

        maven { url 'https://jitpack.io' }

        maven {

//            专为Mapbox配置

            url 'https://api.mapbox.com/downloads/v2/releases/maven'

            authentication {

                basic(BasicAuthentication)

            }

            credentials {

                // Do not change the username below.

                // This should always be `mapbox` (not your username).

                username = 'mapbox'

                // Use the secret token you stored in gradle.properties as the password

                password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""

            }

        }

        google()

        jcenter()

    }

}

task clean(type: Delete) {

    delete rootProject.buildDir

}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容