api / org.gradle.api.artifacts.repositories

Package org.gradle.api.artifacts.repositories



interface ArtifactRepository

A repository for resolving and publishing artifacts.


interface AuthenticationContainer : PolymorphicDomainObjectContainer<Authentication>

Container for configuring repository authentication schemes of type org.gradle.authentication.Authentication.


interface AuthenticationSupported

An artifact repository which supports username/password authentication.


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.


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.


interface IvyArtifactRepositoryMetaDataProvider

The meta-data provider for an Ivy repository. Uses the Ivy module descriptor (ivy.xml) to determine the meta-data for module versions and artifacts.


interface IvyPatternRepositoryLayout : RepositoryLayout

A repository layout that uses user-supplied patterns. Each pattern will be appended to the base URI for the repository. At least one artifact pattern must be specified. If no Ivy patterns are specified, then the artifact patterns will be used. Optionally supports a Maven style layout for the 'organisation' part, replacing any dots with forward slashes. For examples see the reference for org.gradle.api.artifacts.repositories.IvyArtifactRepository#layout(String, org.gradle.api.Action).


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.


interface MetadataSupplierAware

Interface for repositories which support custom metadata suppliers and/or version listers. A custom version lister or metadata supplier can be used as an optimization technique to avoid too many requests on a server. By providing such rules, a plugin or build author can provide the necessary information to perform component selection without having to actually fetch the component metadata on a server.


interface PasswordCredentials : PasswordCredentials

A username/password credentials that can be used to login to password-protected remote repository.


interface RepositoryLayout

Represents the directory structure for a repository. For examples see the reference for org.gradle.api.artifacts.repositories.IvyArtifactRepository#layout(String, org.gradle.api.Action)


interface RepositoryResourceAccessor

Provides access to resources on an artifact repository. Gradle takes care of caching the resources locally. The scope of the cache may depend on the accessor: users should refer to the javadocs of the methods providing an accessor to determine the scope.