Reputation: 8428
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?
Upvotes: 11
Views: 14379
Reputation: 12219
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
Upvotes: 9
Reputation: 8428
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
Upvotes: 15