I can normally view a dependency tree for a project by running ./gradlew dependencies
, but I cannot figure out how to view the dependency tree for the Gradle buildSrc directory.
I have tried accessing it as a sub project, ./gradlew buildSrc:dependencies
but that does not work.
build.gradle (for buildSrc)
repositories { mavenCentral() }
dependencies {
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'junit:junit:4.12'
}
The dependency tree in a build scan renders the selection reason (conflict resolution) as well as the origin of a dependency if you click on a dependency and select the "Required By" tab. Every Gradle project provides the task dependencyInsight to render the so-called dependency insight report from the command line.
Defined dependencies will be loaded from remote repositories into gradle's local repository folder. For each loaded file, gradle will be create a new folder named with md5 value of the original file (pom,jar,..).
Consider the following (the only way that I know of):
$ cd buildSrc
$ gradle dependencies
Note, given your build.gradle
example, that buildSrc
is its own project in Gradle and needs a proper file. Your example doesn't declare any plugins. Assuming you are using Java, a fix is:
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'junit:junit:4.12'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With