Forums : CoPilot

[FAQ] How do I determine which component is bringing in a transitive dependency?

Gradle

Use the DependencyInsightReportTask - add a task to your top-level Gradle file:

task dependencyInsightReport(type: DependencyInsightReportTask) << {}

And then find the occurance of the dependency (replace ${groupId:artifactId:version} with the external ID of the transitive dependency in question):

./gradlew dependencyInsightReport --configuration testRuntime --dependency (${groupId:artifactId:version})

This will output a tree showing the path from the target dependency to your project. The "configuration" argument determines what configuration is searched - testRuntime is used here, as this encompasses the standard compile, runtime, testCompile, and testRuntime configurations.

Maven

Use the tree command of the Maven Dependency plugin (replace ${groupId:artifactId} with the group and artifact IDs of the transitive dependency in question):

mvn dependency:tree -Dincludes=${groupId:artifactId}

This will output a tree showing the path from the target dependency to your project.

7c7cbcfd692bfcc2e16df5379ecdafd3?&s=42&rating=pg&d=https%3a%2f%2fopenhub.net%2fanon80
Nick Ver Voort over 1 year ago
 

Post a Response