We discussed how to use dependency configurations to group together dependencies; we also saw how we must define repositories so that the dependencies can be resolved, but we haven't discussed how to define the actual dependencies yet. We define dependencies in our build project with the dependencies{}
script block. We define a closure to pass to the dependencies{}
script block with the configuration of the dependency.
We can define different types of dependencies. The following table shows the types that we can use:
Dependency type |
Method |
Description |
External module dependency |
- |
This is a dependency on an external module or library in a repository. |
Project dependency |
|
This is a dependency on another Gradle project. |
File dependency |
|
This is a dependency on a collection of files on the local computer. |
Client module dependency |
|
This is a dependency on an external module, where the artifacts are stored in a repository... |