0

In my build.gradle file for the top level build.gradle file - jcenter () is not specifically written. so i have a the following in the top level build.gradle file:

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

buildscript {
    repositories {
        //jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
    }
}

allprojects {
    repositories {
        //jcenter()
    }
}

somehow all my dependencies i have defined in my module are still found and the app runs fine. Can i assume that jcenter() is the default repo then if none is found ? is it used by default ? Otherwise how are my dependencies coming. Also if i wanted to over ride jcenter() to use another repo how would i do it.

so what if i had the following custom repository:

buildscript {
    repositories {
        maven {
            url "https://someEnterpriseRepository.com/myRepo"
        }
    }

does that mean it checks maven custom repo first and then checks jcenter() if dependency is not found ? BTW, i have cleared the IDE cache from file-->invalidate cache before testing all this.

4

1 回答 1

0

如果脚本中没有明确说明的存储库,您的构建可能会工作的唯一两个原因是:

  1. Gradle 使用一个初始化脚本来透明地定义一个存储库。
  2. 依赖项来自您的本地缓存。
于 2015-07-30T17:23:39.007 回答