Whenever I call gradlew dependencies
on a gradle project, I get a list of every configuration's dependencies (which when only compile is configured, usually includes the same thing repeated several times for runtime, test and testRuntime).
Is there a way to specify a particular configuration to view the dependencies of?
In Gradle dependencies are libraries required to build your code. Each of these libraries may have their own dependencies, adding transitive dependencies to your project. This structure is called the Gradle dependency tree, with its own rules on dependency conflict resolution and more.
Right-click on gradle task->"Dependency Tree" to print task dependencies.
If you want to filter by module as well, you can use the following command:
gradlew -p <module-name> dependencies --configuration <configuration-name>
So for example, if you want to output all dependency graphs use:
gradlew dependencies
So for example, if you want to output all dependency graphs for a lib
module use:
gradlew -p lib dependencies
If you want to output compile dependencies for debug variant:
gradlew dependencies --configuration debugCompileClasspath
If you want to output runtime dependencies for debug variant:
gradlew dependencies --configuration debugRuntimeClasspath
If you want to output runtime dependencies for debug variant and production flavor in the lib
module:
gradlew -p lib dependencies --configuration productionDebugRuntimeClasspath
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