首页 > 编程知识 正文

maven配置阿里云仓库,阿里云maven配置文件

时间:2023-05-05 09:43:15 阅读:236523 作者:748

每次开发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}

 

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。