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.

artifact

abstract fun artifact(@DelegatesTo(value = DependencyArtifact::class, strategy = 1) configureClosure: Closure): DependencyArtifact(source)

Adds an artifact to this dependency. The given closure is passed a org.gradle.api.artifacts.DependencyArtifact instance, which it can configure.

If no artifact is added to a dependency, an implicit default artifact is used. This default artifact has the same name as the module and its type and extension is jar. If at least one artifact is explicitly added, the implicit default artifact won't be used any longer.

Return

the added artifact

Since

0.9

See also


abstract fun artifact(configureAction: Action<in DependencyArtifact>): DependencyArtifact(source)

Adds an artifact to this dependency. The given action is passed a org.gradle.api.artifacts.DependencyArtifact instance, which it can configure.

If no artifact is added to a dependency, an implicit default artifact is used. This default artifact has the same name as the module and its type and extension is jar. If at least one artifact is explicitly added, the implicit default artifact won't be used any longer.

Return

the added artifact

Since

3.1

See also