摇篮buildscript依赖 [英] Gradle buildscript dependencies

查看:197
本文介绍了摇篮buildscript依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是什么在构建的gradle的 buildScript 部分或构建的根级别声明库之间的差异。

选项1:

的build.gradle

  buildScript {
    库{
        mavenCentral();
    }
}

的build.gradle

  {库
    mavenCentral();
}


解决方案

在buildScript块的存储库是用于取您的buildScript依赖的相关性。这些都是把你的编译的类路径,并可以从您的构建文件指的依赖关系。例如额外的插件存在在互联网上。

在根目录下的仓库被用来获取您的项目依赖的依赖关系。因此,你需要所有的依赖编译你的项目。

What is the difference between declaring repositories in the buildScript section of the gradle build or in the root level of the build.

Option 1:

build.gradle:

buildScript {
    repositories {
        mavenCentral();
    }
}

or

build.gradle:

repositories {
    mavenCentral();
}

解决方案

The repositories in the buildScript block are used to fetch the dependencies of your buildScript dependencies. These are the dependencies that are put on the classpath of your build and that you can refer to from your build file. For instance extra plugins that exist on the internet.

The repositories on the root level are used to fetch the dependencies that your project depends on. So all the dependencies you need to compile your project.

这篇关于摇篮buildscript依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆