api / org.gradle.api.artifacts.repositories / MetadataSupplierAware

MetadataSupplierAware

@Incubating 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.

Since
4.9

Functions

setComponentVersionsLister

abstract fun setComponentVersionsLister(lister: Class<out ComponentMetadataVersionLister>): Unit
abstract fun setComponentVersionsLister(lister: Class<out ComponentMetadataVersionLister>, configureAction: Action<in ActionConfiguration>): Unit

Sets a custom component versions lister. A versions lister will be called whenever a dynamic version is requested.

setMetadataSupplier

abstract fun setMetadataSupplier(rule: Class<out ComponentMetadataSupplier>): Unit

Sets a custom metadata rule, which is capable of supplying the metadata of a component (status, status scheme, changing flag) whenever a dynamic version is requested. It can be used to provide metadata directly, instead of having to parse the Ivy descriptor.

abstract fun setMetadataSupplier(rule: Class<out ComponentMetadataSupplier>, configureAction: Action<in ActionConfiguration>): Unit

Sets a custom metadata rule, possibly configuring the rule.

Inheritors

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.