org.gradle.api.tasks.diagnostics

## Class DependencyInsightReportTask

- java.lang.Object
- - org.gradle.api.internal.AbstractTask
  - - org.gradle.api.DefaultTask
    - - org.gradle.api.tasks.diagnostics.DependencyInsightReportTask

- All Implemented Interfaces:
    GroovyObject, Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, org.gradle.util.Configurable<Task>

      @Incubating
      public class DependencyInsightReportTask
      extends DefaultTask
      implements GroovyObject

  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 `setDependencySpec(Object)` and `setConfiguration(String)`.

  The task can also be configured from the command line. For more information please refer to `setDependencySpec(Object)` and `setConfiguration(String)`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.gradle.api.Task

      `Task.Namer`

  - ### Field Summary

    - ### Fields inherited from interface org.gradle.api.Task

      `TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DependencyInsightReportTask()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Configuration` | `getConfiguration()` Configuration to look the dependency in
    `Spec<DependencyResult>` | `getDependencySpec()` Selects the dependency (or dependencies if multiple matches found) to show the report for.
    `MetaClass` | `getMetaClass()`
    `Object` | `getProperty(String property)`
    `protected org.gradle.internal.logging.text.StyledTextOutputFactory` | `getTextOutputFactory()`
    `protected org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionComparator` | `getVersionComparator()`
    `protected org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionSelectorScheme` | `getVersionSelectorScheme()`
    `Object` | `invokeMethod(String name, Object args)`
    `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(Object dependencyInsightNotation)` Configures the dependency to show the report for.
    `void` | `setDependencySpec(Spec<DependencyResult> dependencySpec)` The dependency spec selects the dependency (or dependencies if multiple matches found) to show the report for.
    `void` | `setMetaClass(MetaClass metaClass)`

    - ### Methods inherited from class org.gradle.api.internal.AbstractTask

      `addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setName, setOnlyIf, setOnlyIf, setProject, setProperty, setShouldRunAfter, shouldRunAfter, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface groovy.lang.GroovyObject

      `setProperty`

- - ### Constructor Detail

    - #### DependencyInsightReportTask

          public DependencyInsightReportTask()

  - ### Method Detail

    - #### getProperty

          public Object getProperty(String property)

      Specified by:
        `getProperty` in interface `GroovyObject`

    - #### invokeMethod

          public Object invokeMethod(String name,
                            Object args)

      Specified by:
        `invokeMethod` in interface `GroovyObject`

    - #### getMetaClass

          public MetaClass getMetaClass()

      Specified by:
        `getMetaClass` in interface `GroovyObject`

    - #### setMetaClass

          public void setMetaClass(MetaClass metaClass)

      Specified by:
        `setMetaClass` in interface `GroovyObject`

    - #### getDependencySpec

          public Spec<DependencyResult> getDependencySpec()

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

    - #### setDependencySpec

          public 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.

    - #### setDependencySpec

          public 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 `setDependencySpec(Spec)`

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

          gradle dependencyInsight --dependency slf4j

    - #### getConfiguration

          public Configuration getConfiguration()

      Configuration to look the dependency in

    - #### setConfiguration

          public void setConfiguration(Configuration configuration)

      Sets the configuration to look the dependency in.

    - #### setConfiguration

          public 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

    - #### getTextOutputFactory

          @Inject
          protected org.gradle.internal.logging.text.StyledTextOutputFactory getTextOutputFactory()

    - #### getVersionSelectorScheme

          @Inject
          protected org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionSelectorScheme getVersionSelectorScheme()

    - #### getVersionComparator

          @Inject
          protected org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionComparator getVersionComparator()

    - #### report

          public void report()