O'Reilly logo

Gradle Effective Implementation Guide by Hubert Klein Ikkink

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining dependencies

We learned how to use dependency configurations to group together dependencies; we saw how we must define repositories so dependencies can be resolved, but we haven't yet learned how to define the actual dependencies. 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 we can use:

Dependency type

Method

Description

External module dependency

-

A dependency on an external module or library in a repository.

Project dependency

project()

Dependency on another Gradle project.

File dependency

files(), ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required