Package: org.gradle.api.tasks.diagnostics

## [Groovy] Class DependencyInsightReportTask

- org.gradle.api.tasks.diagnostics.DependencyInsightReportTask

- Generates a report that attempts to answer questions like:

  - Why is this dependency in the dependency graph?
  - Exactly which dependencies are pulling this dependency into the graph?
  - What is the actual version (i.e. *selected* version) of the dependency that will be used? Is it the same as what was *requested*?
  - Why is the *selected* version of a dependency different to the *requested*?
  Use this task to get insight into a particular dependency (or dependencies) and find out what exactly happens during dependency resolution and conflict resolution. If the dependency version was forced or selected by the conflict resolution this information will be available in the report.

  While the regular dependencies report (DependencyReportTask) shows the path from the top level dependencies down through the transitive dependencies, the dependency insight report shows the path from a particular dependency to the dependencies that pulled it in. That is, it is an inverted view of the regular dependencies report.

  The task requires setting the dependency spec and the configuration. For more information on how to configure those please refer to docs for DependencyInsightReportTask.setDependencySpec and DependencyInsightReportTask.setConfiguration.

  The task can also be configured from the command line. For more information please refer to DependencyInsightReportTask.setDependencySpec and DependencyInsightReportTask.setConfiguration

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class org.gradle.api.internal.AbstractTask` | `TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION`

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `Configuration` | `configuration` Configuration to look the dependency in
    `Spec<DependencyResult>` | `dependencySpec` Selects the dependency (or dependencies if multiple matches found) to show the report for.

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `protected org.gradle.logging.StyledTextOutputFactory` | `getTextOutputFactory()`
    `protected org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionMatcher` | `getVersionMatcher()`
    `void` | `report()`
    `void` | `setConfiguration(Configuration configuration)` Sets the configuration to look the dependency in.
    `void` | `setConfiguration(String configurationName)` Sets the configuration (via name) to look the dependency in.
    `void` | `setDependencySpec(Spec<DependencyResult> dependencySpec)` The dependency spec selects the dependency (or dependencies if multiple matches found) to show the report for.
    `void` | `setDependencySpec(Object dependencyInsightNotation)` Configures the dependency to show the report for.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class org.gradle.api.internal.AbstractTask` | `org.gradle.api.internal.AbstractTask#setProperty(java.lang.String, java.lang.Object), org.gradle.api.internal.AbstractTask#toString(), org.gradle.api.internal.AbstractTask#compareTo(java.lang.Object), org.gradle.api.internal.AbstractTask#compareTo(org.gradle.api.Task), org.gradle.api.internal.AbstractTask#getName(), org.gradle.api.internal.AbstractTask#getActions(), org.gradle.api.internal.AbstractTask#getState(), org.gradle.api.internal.AbstractTask#getState(), org.gradle.api.internal.AbstractTask#setName(java.lang.String), org.gradle.api.internal.AbstractTask#getPath(), org.gradle.api.internal.AbstractTask#getExtensions(), org.gradle.api.internal.AbstractTask#getLogger(), org.gradle.api.internal.AbstractTask#execute(), org.gradle.api.internal.AbstractTask#configure(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#configure(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#getDescription(), org.gradle.api.internal.AbstractTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#isEnabled(), org.gradle.api.internal.AbstractTask#property(java.lang.String), org.gradle.api.internal.AbstractTask#setEnabled(boolean), org.gradle.api.internal.AbstractTask#getLogging(), org.gradle.api.internal.AbstractTask#getLogging(), org.gradle.api.internal.AbstractTask#hasProperty(java.lang.String), org.gradle.api.internal.AbstractTask#getConvention(), org.gradle.api.internal.AbstractTask#setDescription(java.lang.String), org.gradle.api.internal.AbstractTask#getGroup(), org.gradle.api.internal.AbstractTask#setGroup(java.lang.String), org.gradle.api.internal.AbstractTask#dependsOnTaskDidWork(), org.gradle.api.internal.AbstractTask#getInputs(), org.gradle.api.internal.AbstractTask#getTemporaryDir(), org.gradle.api.internal.AbstractTask#mustRunAfter([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#setMustRunAfter(java.lang.Iterable), org.gradle.api.internal.AbstractTask#getMustRunAfter(), org.gradle.api.internal.AbstractTask#finalizedBy([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#setFinalizedBy(java.lang.Iterable), org.gradle.api.internal.AbstractTask#getFinalizedBy(), org.gradle.api.internal.AbstractTask#shouldRunAfter([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#setShouldRunAfter(java.lang.Iterable), org.gradle.api.internal.AbstractTask#getShouldRunAfter(), org.gradle.api.internal.AbstractTask#setOnlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.AbstractTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#setDidWork(boolean), org.gradle.api.internal.AbstractTask#getDidWork(), org.gradle.api.internal.AbstractTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#doFirst(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#doLast(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#doLast(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#deleteAllActions(), org.gradle.api.internal.AbstractTask#getEnabled(), org.gradle.api.internal.AbstractTask#getAnt(), org.gradle.api.internal.AbstractTask#getOutputs(), org.gradle.api.internal.AbstractTask#getOutputs(), org.gradle.api.internal.AbstractTask#setActions(java.util.List), org.gradle.api.internal.AbstractTask#getTaskDependencies(), org.gradle.api.internal.AbstractTask#getTaskDependencies(), org.gradle.api.internal.AbstractTask#getDependsOn(), org.gradle.api.internal.AbstractTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.AbstractTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.AbstractTask#getProject(), org.gradle.api.internal.AbstractTask#getStandardOutputCapture(), org.gradle.api.internal.AbstractTask#getAsDynamicObject(), org.gradle.api.internal.AbstractTask#getTaskActions(), org.gradle.api.internal.AbstractTask#getOnlyIf(), org.gradle.api.internal.AbstractTask#executeWithoutThrowingTaskFailure(), org.gradle.api.internal.AbstractTask#getExecuter(), org.gradle.api.internal.AbstractTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.AbstractTask#getValidators(), org.gradle.api.internal.AbstractTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.AbstractTask#setProject(org.gradle.api.Project), org.gradle.api.internal.AbstractTask#getImpliesSubProjects(), org.gradle.api.internal.AbstractTask#setImpliesSubProjects(boolean), org.gradle.api.internal.AbstractTask#getTemporaryDirFactory(), org.gradle.api.internal.AbstractTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.AbstractTask#wait(long, int), org.gradle.api.internal.AbstractTask#wait(long), org.gradle.api.internal.AbstractTask#wait(), org.gradle.api.internal.AbstractTask#equals(java.lang.Object), org.gradle.api.internal.AbstractTask#hashCode(), org.gradle.api.internal.AbstractTask#getClass(), org.gradle.api.internal.AbstractTask#notify(), org.gradle.api.internal.AbstractTask#notifyAll()`

- - ### Property Detail

    - #### Configuration configuration

      Configuration to look the dependency in

    - #### Spec<DependencyResult> dependencySpec

      Selects the dependency (or dependencies if multiple matches found) to show the report for.

  - ### Method Detail

    - #### @javax.inject.Inject protected org.gradle.logging.StyledTextOutputFactory getTextOutputFactory()

    - #### @javax.inject.Inject protected org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionMatcher getVersionMatcher()

    - #### @TaskAction void report()

    - #### void setConfiguration(Configuration configuration)

      Sets the configuration to look the dependency in.

      Parameters:
        configuration

    - #### @org.gradle.api.internal.tasks.options.Option(option = "configuration", description = "Looks for the dependency in given configuration.") void setConfiguration(String configurationName)

      Sets the configuration (via name) to look the dependency in.

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

          gradle dependencyInsight --configuration runtime --dependency slf4j

      Parameters:
        configurationName

    - #### void setDependencySpec(Spec<DependencyResult> dependencySpec)

      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.

      Parameters:
        dependencySpec

    - #### @org.gradle.api.internal.tasks.options.Option(option = "dependency", description = "Shows the details of given dependency.") void setDependencySpec(Object dependencyInsightNotation)

      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

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

          gradle dependencyInsight --dependency slf4j

      Parameters:
        dependencyInsightNotation