# JvmComponentDependencies

@Incubating
interface JvmComponentDependencies : PlatformDependencyModifiers, TestFixturesDependencyModifiers, GradleDependencies(source)

This DSL element is used to add dependencies to a component, for instance a TestSuite

- `implementation` dependencies are used at compilation and runtime.
- `compileOnly` dependencies are used only at compilation and are not available at runtime.
- `runtimeOnly` dependencies are not available at compilation and are used only at runtime.
- `annotationProcessor` dependencies are used only at compilation for the annotation processor classpath

#### Since

7.3

#### See also

DependencyHandler

For more information.

## Functions

constraint
Link copied to clipboard
open fun constraint(dependencyConstraintNotation: CharSequence): DependencyConstraint
Create a DependencyConstraint from the given notation.
open fun constraint(project: ProjectDependency): DependencyConstraint
Create a DependencyConstraint from a project.
@Incubating
open fun constraint(dependencyConstraint: Provider<out MinimalExternalModuleDependency>): Provider<out DependencyConstraint>
@Incubating
open fun constraint(dependencyConstraint: ProviderConvertible<out MinimalExternalModuleDependency>): Provider<out DependencyConstraint>
Create a DependencyConstraint from a minimal dependency.
getAnnotationProcessor
Link copied to clipboard
abstract fun getAnnotationProcessor(): DependencyCollector
Returns a DependencyCollector that collects the set of annotation processor dependencies.
getCompileOnly
Link copied to clipboard
abstract fun getCompileOnly(): DependencyCollector
Returns a DependencyCollector that collects the set of compile-only dependencies.
getDependencyConstraintFactory
Link copied to clipboard
@Inject
abstract fun getDependencyConstraintFactory(): DependencyConstraintFactory
A dependency constraint factory is used to convert supported dependency notations into DependencyConstraint instances.
getDependencyFactory
Link copied to clipboard
@Inject
abstract fun getDependencyFactory(): DependencyFactory
A dependency factory is used to convert supported dependency notations into org.gradle.api.artifacts.Dependency instances.
getEnforcedPlatform
Link copied to clipboard
abstract fun getEnforcedPlatform(): PlatformDependencyModifiers.EnforcedPlatformDependencyModifier
A dependency modifier that can modify a dependency to select an enforced platform variant.
getImplementation
Link copied to clipboard
abstract fun getImplementation(): DependencyCollector
Returns a DependencyCollector that collects the set of implementation dependencies.
getObjectFactory
Link copied to clipboard
@Inject
abstract fun getObjectFactory(): ObjectFactory
Injected service to create named objects.
getPlatform
Link copied to clipboard
abstract fun getPlatform(): PlatformDependencyModifiers.PlatformDependencyModifier
A dependency modifier that can modify a dependency to select a platform variant.
getProject
Link copied to clipboard
@Inject
abstract fun getProject(): Project
The current project.
getRuntimeOnly
Link copied to clipboard
abstract fun getRuntimeOnly(): DependencyCollector
Returns a DependencyCollector that collects the set of runtime-only dependencies.
getTestFixtures
Link copied to clipboard
abstract fun getTestFixtures(): TestFixturesDependencyModifiers.TestFixturesDependencyModifier
A dependency modifier that can modify a dependency to select a test fixtures variant.
gradleApi
Link copied to clipboard
open fun gradleApi(): Dependency
Creates a dependency on the API of the current version of Gradle.
gradleTestKit
Link copied to clipboard
open fun gradleTestKit(): Dependency
Creates a dependency on the Gradle test-kit API.
localGroovy
Link copied to clipboard
open fun localGroovy(): Dependency
Creates a dependency on the version of Groovy that is distributed with the current version of Gradle.
module
Link copied to clipboard
open fun module(dependencyNotation: CharSequence): ExternalModuleDependency
Create an ExternalModuleDependency from the given notation.
open fun module(@Nullable group: @Nullable String, name: String, @Nullable version: @Nullable String): ExternalModuleDependency
Create an ExternalModuleDependency from a series of strings.
project
Link copied to clipboard
open fun project(): ProjectDependency
Returns the current project as a ProjectDependency.
open fun project(projectPath: String): ProjectDependency
Converts an absolute or relative path to a project into a ProjectDependency.