Package org.gradle.api.artifacts.dsl

# Interface Dependencies

All Known Subinterfaces:
  `GradleDependencies`, `JvmComponentDependencies`

public interface Dependencies
Universal APIs that are available for all `dependencies` blocks.

Since:
  7.6
See Also:
  - Creating custom dependencies blocks.
API Note:
  This interface is intended to be used to mix-in DSL methods for `dependencies` blocks.
Implementation Requirements:
  The default implementation of all methods should not be overridden.
Implementation Note:
  Changes to this interface may require changes to the `extension module for Groovy DSL` or `extension functions for Kotlin DSL`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default DependencyConstraint`
  `constraint(CharSequence dependencyConstraintNotation)`
  Create a `DependencyConstraint` from the given notation.
  `default DependencyConstraint`
  `constraint(ProjectDependency project)`
  Create a `DependencyConstraint` from a project.
  `default Provider<? extends DependencyConstraint>`
  `constraint(Provider<? extends MinimalExternalModuleDependency> dependencyConstraint)`
  Create a `DependencyConstraint` from a minimal dependency.
  `default Provider<? extends DependencyConstraint>`
  `constraint(ProviderConvertible<? extends MinimalExternalModuleDependency> dependencyConstraint)`
  Create a `DependencyConstraint` from a minimal dependency.
  `DependencyConstraintFactory`
  `getDependencyConstraintFactory()`
  A dependency constraint factory is used to convert supported dependency notations into `DependencyConstraint` instances.
  `DependencyFactory`
  `getDependencyFactory()`
  A dependency factory is used to convert supported dependency notations into `Dependency` instances.
  `ObjectFactory`
  `getObjectFactory()`
  Deprecated.
  This method is deprecated and will be removed in Gradle 10.
  `Project`
  `getProject()`
  Deprecated.
  This method is deprecated and will be removed in Gradle 10.
  `default ExternalModuleDependency`
  `module(@Nullable String group, String name, @Nullable String version)`
  Deprecated.
  This method will be removed in Gradle 10.
  `default ExternalModuleDependency`
  `module(CharSequence dependencyNotation)`
  Create an `ExternalModuleDependency` from the given notation.
  `default ProjectDependency`
  `project()`
  Returns the current project as a `ProjectDependency`.
  `default ProjectDependency`
  `project(String projectPath)`
  Converts an absolute or relative path to a project into a `ProjectDependency`.

- ## Method Details

  - ### getDependencyFactory

    @Inject DependencyFactory getDependencyFactory()
    A dependency factory is used to convert supported dependency notations into `Dependency` instances.
    Returns:
      a dependency factory
    See Also:
      - `DependencyFactory`
    Implementation Requirements:
      Do not implement this method. Gradle generates the implementation automatically.

  - ### getDependencyConstraintFactory

    @Inject DependencyConstraintFactory getDependencyConstraintFactory()
    A dependency constraint factory is used to convert supported dependency notations into `DependencyConstraint` instances.
    Returns:
      a dependency constraint factory
    See Also:
      - `DependencyConstraintFactory`
    Implementation Requirements:
      Do not implement this method. Gradle generates the implementation automatically.

  - ### getProject

    @Inject @Deprecated Project getProject()
    Deprecated.
    This method is deprecated and will be removed in Gradle 10.
    The current project. You need to use `project()` or `project(String)` to add a `ProjectDependency`.
    Returns:
      current project
    Since:
      8.0
    Implementation Requirements:
      Do not implement this method. Gradle generates the implementation automatically.

  - ### project

    default ProjectDependency project(String projectPath)
    Converts an absolute or relative path to a project into a `ProjectDependency`. Project paths are separated by colons. This method fails if the project cannot be found.
    Parameters:
      `projectPath` - an absolute or relative path (from the current project) to a project
    Returns:
      a `ProjectDependency` for the given path
    See Also:
      - `Project.project(String)`

  - ### project

    default ProjectDependency project()
    Returns the current project as a `ProjectDependency`.
    Returns:
      the current project as a dependency

  - ### module

    default ExternalModuleDependency module(CharSequence dependencyNotation)
    Create an `ExternalModuleDependency` from the given notation.
    Parameters:
      `dependencyNotation` - dependency to add
    Returns:
      the new dependency
    See Also:
      - `Valid dependency notation for this method`

  - ### module

    @Deprecated default ExternalModuleDependency module(@Nullable String group, String name, @Nullable String version)
    Deprecated.
    This method will be removed in Gradle 10. Use single-string notation instead.
    Create an `ExternalModuleDependency` from a series of strings.
    Parameters:
      `group` - the group (optional)
      `name` - the name
      `version` - the version (optional)
    Returns:
      the new dependency

  - ### constraint

    default DependencyConstraint constraint(CharSequence dependencyConstraintNotation)
    Create a `DependencyConstraint` from the given notation.
    Parameters:
      `dependencyConstraintNotation` - dependency constraint to add
    Returns:
      the new dependency constraint
    Since:
      8.7
    See Also:
      - `Valid dependency constraint notation for this method`

  - ### constraint

    @Incubating default Provider<? extends DependencyConstraint> constraint(Provider<? extends MinimalExternalModuleDependency> dependencyConstraint)
    Create a `DependencyConstraint` from a minimal dependency.
    Parameters:
      `dependencyConstraint` - dependency constraint to add
    Returns:
      the new dependency constraint
    Since:
      8.7

  - ### constraint

    @Incubating default Provider<? extends DependencyConstraint> constraint(ProviderConvertible<? extends MinimalExternalModuleDependency> dependencyConstraint)
    Create a `DependencyConstraint` from a minimal dependency.
    Parameters:
      `dependencyConstraint` - dependency constraint to add
    Returns:
      the new dependency constraint
    Since:
      8.7

  - ### constraint

    default DependencyConstraint constraint(ProjectDependency project)
    Create a `DependencyConstraint` from a project.
    Parameters:
      `project` - the project
    Returns:
      the new dependency constraint
    Since:
      8.7

  - ### getObjectFactory

    @Inject @Deprecated ObjectFactory getObjectFactory()
    Deprecated.
    This method is deprecated and will be removed in Gradle 10.
    Injected service to create named objects.
    Returns:
      injected service
    Implementation Requirements:
      Do not implement this method. Gradle generates the implementation automatically.