For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

DependencyFactory

Factory class for creating Dependency instances, with strong typing.

An instance of the factory can be injected into a task, plugin or other object by annotating a public constructor or property getter method with javax.inject.Inject. It is also available via getDependencyFactory.

Note: This interface is not intended for implementation by build script or plugin authors.

Since

7.6

Functions

Link copied to clipboard
abstract fun create(dependencyNotation: CharSequence): ExternalModuleDependency
Create an ExternalModuleDependency from the "group:name:version:classifier@extension" notation.
abstract fun create(project: Project): ProjectDependency
Create a ProjectDependency from a Project.
abstract fun create(fileCollection: FileCollection): FileCollectionDependency
abstract fun create(@Nullable group: @Nullable String, name: String, @Nullable version: @Nullable String): ExternalModuleDependency
abstract fun create(@Nullable group: @Nullable String, name: String, @Nullable version: @Nullable String, @Nullable classifier: @Nullable String, @Nullable extension: @Nullable String): ExternalModuleDependency
Create an ExternalModuleDependency from a series of strings.
Link copied to clipboard
Create a ProjectDependency for the current project.
Create a ProjectDependency from a Project path.
Link copied to clipboard
abstract fun gradleApi(): Dependency
Creates a dependency on the API of the current version of Gradle.
Link copied to clipboard
abstract fun gradleTestKit(): Dependency
Creates a dependency on the Gradle test-kit API.
Link copied to clipboard
abstract fun localGroovy(): Dependency
Creates a dependency on the version of Groovy that is distributed with the current version of Gradle.