How to get insight of a dependency for the “implem

2019-06-17 03:18发布

问题:

Based on documentation (4.7.6 - Getting the insight into a particular dependency) we can get the insights for a particular configuration specifying the configuration itself. In the example they are using as configuration compile, which is deprecated. I tried to reproduce the same command replacing, in build.gradle, the compile configuration with the implementation configuration (as I got we are not supposed to use compile anymore). But when I run:

gradle dependencyInsight --dependency groovy --configuration implementation

Gradle is returning:

Execution failed for task ':dependencyInsight'.
Resolving configuration 'implementation' directly is not allowed

My build.gradle file is the following:

apply plugin: 'java-library'

repositories {
    jcenter()
}

dependencies{
    implementation 'org.codehaus.groovy:groovy-all:2.4.10'
}

Does it mean I cannot get the insight of a dependency if I'm using implementation or is there another way to get it?

回答1:

I had a similar problem, and asked around, and got this answer:

The configuration is compileClasspath. If you have variants, there is a configuration per-variant (i.e. for the release variant, your configuration would be releaseCompileConfiguration).


full example - no variants: gradle dependencyInsight --dependency groovy --configuration compileClasspath
full example - release variant: gradle dependencyInsight --dependency groovy --configuration releaseCompileClasspath



标签: gradle