api / org.gradle.api.artifacts.repositories / ArtifactRepository

ArtifactRepository

interface ArtifactRepository

A repository for resolving and publishing artifacts.

Functions

getName

abstract fun getName(): String

Returns the name for this repository. A name must be unique amongst a repository set. A default name is provided for the repository if none is provided.

The name is used in logging output and error reporting to point to information related to this repository.

setName

abstract fun setName(name: String): Unit

Sets the name for this repository. If this repository is to be added to an org.gradle.api.artifacts.ArtifactRepositoryContainer (including org.gradle.api.artifacts.dsl.RepositoryHandler), its name cannot be changed after it has been added to the container.

Inheritors

FlatDirectoryArtifactRepository

interface FlatDirectoryArtifactRepository : ArtifactRepository

A repository that looks into a number of directories for artifacts. The artifacts are expected to be located in the root of the specified directories. The repository ignores any group/organization information specified in the dependency section of your build script. If you only use this kind of resolver you can specify your dependencies like :junit:4.8.1 instead of junit:junit:4.8.1.

To resolve a dependency, this resolver looks for one of the following files. It will return the first match it finds:

  • [artifact]-[version].[ext]
  • [artifact]-[version]-[classifier].[ext]
  • [artifact].[ext]
  • [artifact]-[classifier].[ext]
So, for example, to resolve :junit:junit:4.8.1, this repository will look for junit-4.8.1.jar and then junit.jar.

IvyArtifactRepository

interface IvyArtifactRepository : ArtifactRepository, AuthenticationSupported, MetadataSupplierAware

An artifact repository which uses an Ivy format to store artifacts and meta-data.

When used to resolve metadata and artifact files, all available patterns will be searched.

When used to upload metadata and artifact files, only a single, primary pattern will be used:

  1. If a URL is specified via #setUrl(Object) then that URL will be used for upload, combined with the applied #layout(String).
  2. If no URL has been specified but additional patterns have been added via #artifactPattern or #ivyPattern, then the first defined pattern will be used.

Repositories of this type are created by the org.gradle.api.artifacts.dsl.RepositoryHandler#ivy(org.gradle.api.Action) group of methods.

MavenArtifactRepository

interface MavenArtifactRepository : ArtifactRepository, AuthenticationSupported, MetadataSupplierAware

An artifact repository which uses a Maven format to store artifacts and meta-data.

Repositories of this type are created by the org.gradle.api.artifacts.dsl.RepositoryHandler#maven(org.gradle.api.Action) group of methods.

MavenResolver

interface MavenResolver : ArtifactRepository, PomFilterContainer

An ArtifactRepository which can be used to publish artifacts to Maven repositories.

PrebuiltLibraries

interface PrebuiltLibraries : ArtifactRepository, NamedDomainObjectSet<PrebuiltLibrary>

A container of PrebuiltLibrary instances.