Using gradle dependencies
I get a huge list of all dependencies. Showing all dependencies the projects I depend on have. Is it possible to limit the depth of the shown list?
Example:
+--- com.company.common:e-common-junit:0.29.0-SNAPSHOT
| +--- junit:junit:4.11 (*)
| \--- commons-io:commons-io:2.4
\--- org.slf4j:slf4j-log4j12:1.7.6
+--- org.slf4j:slf4j-api:1.7.6
\--- log4j:log4j:1.2.17
Limited to only +--- com.company.common:e-common-junit:0.29.0-SNAPSHOT
From the gradle site:
dependencies - Displays all dependencies declared in root project 'projectReports'.
api:dependencies - Displays all dependencies declared in project ':api'.
webapp:dependencies - Displays all dependencies declared in project ':webapp'.
It even mentiones that these reports can get large at this official source.
Stating that I should use --configuration
, but as far as my understanding of this article goes it would only limit it to compile
, testCompile
and so on, not in depth.
Version in use gradle 2.11
It means that dependency graph contains multiple dependencies with the same group and module but different versions for e.g. org.
Dependency constraints allow you to define the version or the version range of both dependencies declared in the build script and transitive dependencies. It is the preferred method to express constraints that should be applied to all dependencies of a configuration.
Given a required dependency, with a version, Gradle attempts to resolve the dependency by searching for the module the dependency points at. Each repository is inspected in order. Depending on the type of repository, Gradle looks for metadata files describing the module ( .
main. runtimeClasspath' contains the compiled classes of the source set, and task autowiring automatically adds the necessary task dependencies. Maybe you want 'sourceSets. main. compileClasspath'.
Use grep:
Show only top level dependencies:gradle dependencies --configuration compile | grep -v '| '
Show two levels:gradle dependencies --configuration compile | grep -v '| | '
etc
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