If we want to add dependencies from a repository in a Gradle build file, we must explicitly add the repositories
configuration block. Within the configuration block, we define the location of the repository and maybe some extra configuration. In the following example of a build file, we define a Maven repository with a custom location:
// Repositories configuration block, // must be present to define and // configure repositories to get // dependencies in our build script. repositories { // Sample Maven repository with a // custom location. maven { url 'http://mycompany.net/maven' } }
We can include several repositories in our build file. We can even mix the type of repositories, for example to, include both the Ivy repository and a local filesystem. Gradle supports the following types of repositories: