What is the difference between declaring repositories in the buildscript section of the gradle build or in the root level of the build.
buildscript {
repositories {
mavenCentral();
}
}
versus
repositories {
mavenCentral();
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The repositories in the
buildscriptblock are used to fetch the dependencies of yourbuildscriptdependencies. 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.