Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Gradle Dependency Management
  • Table Of Contents Toc
  • Feedback & Rating feedback
Gradle Dependency Management

Gradle Dependency Management

By : Hubert Klein Ikkink
5 (3)
close
close
Gradle Dependency Management

Gradle Dependency Management

5 (3)
By: Hubert Klein Ikkink

Overview of this book

If you work on Java projects, use Gradle as a build automation tool, and you use dependencies in your project, this is the book for you. Additionally, if you want to deploy your project artifacts as dependencies for other developers using Gradle, you've found the right book.
Table of Contents (9 chapters)
close
close
8
Index

Customizing dependency resolution rules

For each dependency we define in our build file, there is a dependency resolution rule. This rule is executed when the dependency needs to be resolved. We can customize this rule in our build file, so we can change certain parts of the rule before the dependency is actually resolved. Gradle allows us to change the dependency group, name, and version with a customized resolution rule. This way, we can even completely replace dependencies with other dependencies or force a particular version.

Dependency resolution rule details are implemented in the org.gradle.api.artifacts.DependencyResolveDetails class. Inside the resolutionStrategy configuration block, we use the eachDependency method to customize a resolution rule. This method accepts a closure, and the closure argument is an instance of DependencyResolveDetails. We use the useVersion and useTarget methods of DependencyResolveDetails to change either the version or the complete group, name, and version...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Gradle Dependency Management
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon