See dependency tree for single configuration in gradle (using `dependencies` task)

The command is: gradle[w] dependencies --configuration <configuration_name>

In my case, I want to see just compile configuration so I would type:

gradlew dependencies --configuration compile

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