What is this?

This is a page about io.github.alexiyorlov.gradle.subdeps Gradle plugin (further called "SPD"). It shows the use cases for this plugin and how to configure it.

Use case

SPD is intended to work in a multi-module project (project with sub-projects). Its goal is to administer subproject's dependencies from the main project. With default configuration SPD "passes" all parent project dependency configurations to all of its sub-projects and adds a dependency on the parent itself. Reminder: subprojects are defined in the 'settings.gradle' file of the parent project. Initially SPD is set to simulate its work, because it applies to the project immediately after evaluation.

Usage

SPD adds an extension "subprojectDeps", where you can configure it. Here is a small example how to do that:


plugins {
    id 'java'
    id 'io.github.alexiyorlov.gradle.subdeps' version [version]
}

...

subprojectDeps{
    simulate(false)
    dependOnParent(true)
    setPassedConfigurations("implementation")
    excludeProjects('subproject2')

}

dependencies {
    implementation('com.google.code.findbugs:jsr305:3.0.2')
    testImplementation group: 'junit', name: 'junit', version: '4.12'
    ...
}

Thus you can avoid re-declaring dependencies in the subprojects.