api / org.gradle.api.tasks.diagnostics / DependencyInsightReportTask / setDependencySpec

setDependencySpec

open fun setDependencySpec(dependencySpec: Spec<DependencyResult>): Unit

The dependency spec selects the dependency (or dependencies if multiple matches found) to show the report for. The spec receives an instance of DependencyResult as parameter.

open fun setDependencySpec(dependencyInsightNotation: Any): Unit

Configures the dependency to show the report for. Multiple notation formats are supported: Strings, instances of Spec and groovy closures. Spec and closure receive DependencyResult as parameter. Examples of String notation: 'org.slf4j:slf4j-api', 'slf4j-api', or simply: 'slf4j'. The input may potentially match multiple dependencies. See also DependencyInsightReportTask#setDependencySpec(Spec)

This method is exposed to the command line interface. Example usage:

gradle dependencyInsight --dependency slf4j