Linux command
gradle-dependencyinsight 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Trace a dependency
gradle dependencyInsight --dependency [library-name]
Trace a dependency
gradle dependencyInsight --configuration [compileClasspath] --dependency [guava]
Show only a single path
gradle dependencyInsight --dependency [library-name] --singlepath
Trace a dependency
gradle :[subproject]:dependencyInsight --dependency [library-name]
说明
gradle dependencyInsight traces why a specific dependency appears in the build. It shows the path from direct dependencies to the transitive inclusion, revealing how version conflicts are resolved. The --dependency value is matched partially against the group, name, or version of dependencies, so a query like `guava` will match `com.google.guava:guava:31.1-jre`. The task is essential for debugging dependency issues and understanding why specific versions are selected during resolution.
参数
- --dependency _NAME_
- Required. The dependency to trace. Matches partially against group, name, or version.
- --configuration _NAME_
- Configuration to inspect (e.g., compileClasspath, runtimeClasspath). Defaults to compileClasspath for Java projects.
- --singlepath
- Show only one path to each dependency instead of all paths. Useful for large dependency graphs.
FAQ
What is the gradle-dependencyinsight command used for?
gradle dependencyInsight traces why a specific dependency appears in the build. It shows the path from direct dependencies to the transitive inclusion, revealing how version conflicts are resolved. The --dependency value is matched partially against the group, name, or version of dependencies, so a query like `guava` will match `com.google.guava:guava:31.1-jre`. The task is essential for debugging dependency issues and understanding why specific versions are selected during resolution.
How do I run a basic gradle-dependencyinsight example?
Run `gradle dependencyInsight --dependency [library-name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --dependency _NAME_ do in gradle-dependencyinsight?
Required. The dependency to trace. Matches partially against group, name, or version.