ArtifactRepository
, AuthenticationSupported
, MetadataSupplierAware
, UrlArtifactRepository
public interface IvyArtifactRepository extends ArtifactRepository, UrlArtifactRepository, AuthenticationSupported, MetadataSupplierAware
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:
setUrl(Object)
then that URL will be used for upload, combined with the applied layout(String)
.artifactPattern(java.lang.String)
or ivyPattern(java.lang.String)
, then the first defined pattern will be used.
Repositories of this type are created by the RepositoryHandler.ivy(org.gradle.api.Action)
group of methods.
Modifier and Type | Interface | Description |
---|---|---|
static interface |
IvyArtifactRepository.MetadataSources |
Allows configuring the sources of metadata for a specific repository.
|
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
GRADLE_ARTIFACT_PATTERN |
|
static java.lang.String |
GRADLE_IVY_PATTERN |
|
static java.lang.String |
IVY_ARTIFACT_PATTERN |
|
static java.lang.String |
MAVEN_ARTIFACT_PATTERN |
|
static java.lang.String |
MAVEN_IVY_PATTERN |
Modifier and Type | Method | Description |
---|---|---|
void |
artifactPattern(java.lang.String pattern) |
Adds an independent pattern that will be used to locate artifact files in this repository.
|
IvyArtifactRepository.MetadataSources |
getMetadataSources() |
Returns the current metadata sources configuration for the repository.
|
IvyArtifactRepositoryMetaDataProvider |
getResolve() |
Returns the meta-data provider used when resolving artifacts from this repository.
|
java.net.URI |
getUrl() |
The base URL of this repository.
|
void |
ivyPattern(java.lang.String pattern) |
Adds an independent pattern that will be used to locate ivy files in this repository.
|
void |
layout(java.lang.String layoutName) |
Specifies how the items of the repository are organized.
|
void |
metadataSources(Action<? super IvyArtifactRepository.MetadataSources> configureAction) |
Configures the metadata sources for this repository.
|
void |
patternLayout(Action<? super IvyPatternRepositoryLayout> config) |
Specifies how the items of the repository are organized.
|
void |
setMetadataSupplier(java.lang.Class<? extends ComponentMetadataSupplier> rule) |
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.
|
void |
setMetadataSupplier(java.lang.Class<? extends ComponentMetadataSupplier> rule,
Action<? super ActionConfiguration> configureAction) |
Sets a custom metadata rule, possibly configuring the rule.
|
void |
setUrl(java.lang.Object url) |
Sets the base URL of this repository.
|
void |
setUrl(java.net.URI url) |
Sets the base URL of this repository.
|
content, getName, setName
authentication, credentials, credentials, credentials, getAuthentication, getCredentials, getCredentials
setComponentVersionsLister, setComponentVersionsLister
isAllowInsecureProtocol, setAllowInsecureProtocol
static final java.lang.String IVY_ARTIFACT_PATTERN
static final java.lang.String GRADLE_ARTIFACT_PATTERN
static final java.lang.String GRADLE_IVY_PATTERN
static final java.lang.String MAVEN_ARTIFACT_PATTERN
static final java.lang.String MAVEN_IVY_PATTERN
java.net.URI getUrl()
getUrl
in interface UrlArtifactRepository
void setUrl(java.net.URI url)
setUrl
in interface UrlArtifactRepository
url
- The base URL.void setUrl(java.lang.Object url)
Project.uri(Object)
. This means,
for example, you can pass in a File object or a relative path which is evaluated relative to the project directory.
File are resolved based on the supplied URL and the configured layout(String)
for this repository.setUrl
in interface UrlArtifactRepository
url
- The base URL.void artifactPattern(java.lang.String pattern)
ivyPattern(String)
.
If this pattern is not a fully-qualified URL, it will be interpreted as a file relative to the project directory.
It is not interpreted relative the URL specified in setUrl(Object)
.
Patterns added in this way will be in addition to any layout-based patterns added via setUrl(Object)
.pattern
- The artifact pattern.void ivyPattern(java.lang.String pattern)
setUrl(Object)
.
Patterns added in this way will be in addition to any layout-based patterns added via setUrl(Object)
.pattern
- The ivy pattern.void layout(java.lang.String layoutName)
Recognised values are as follows:
A Repository Layout that applies the following patterns:
$baseUri/"[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier])(.[ext])"
$baseUri/"[organisation]/[module]/[revision]/ivy-[revision].xml"
A Repository Layout that applies the following patterns:
$baseUri/"[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier])(.[ext])"
$baseUri/"[organisation]/[module]/[revision]/ivy-[revision].xml"
Following the Maven convention, the 'organisation' value is further processed by replacing '.' with '/'.
A Repository Layout that applies the following patterns:
$baseUri/"[organisation]/[module]/[revision]/[type]s/[artifact](.[ext])"
$baseUri/"[organisation]/[module]/[revision]/[type]s/[artifact](.[ext])"
layoutName
- The name of the layout to use.patternLayout(Action)
void patternLayout(Action<? super IvyPatternRepositoryLayout> config)
The layout is configured with the supplied closure.
repositories { ivy { patternLayout { artifact '[module]/[revision]/[artifact](.[ext])' ivy '[module]/[revision]/ivy.xml' } } }
The available pattern tokens are listed as part of Ivy's Main Concepts documentation.
config
- The action used to configure the layout.IvyArtifactRepositoryMetaDataProvider getResolve()
void setMetadataSupplier(java.lang.Class<? extends ComponentMetadataSupplier> rule)
setMetadataSupplier
in interface MetadataSupplierAware
rule
- the class of the rule. Gradle will instantiate a new rule for each dependency which requires metadata.void setMetadataSupplier(java.lang.Class<? extends ComponentMetadataSupplier> rule, Action<? super ActionConfiguration> configureAction)
setMetadataSupplier
in interface MetadataSupplierAware
rule
- the class of the rule. Gradle will instantiate a new rule for each dependency which requires metadata.configureAction
- the action to use to configure the rule.void metadataSources(Action<? super IvyArtifactRepository.MetadataSources> configureAction)
configureAction
- the configuration of metadata sources.IvyArtifactRepository.MetadataSources getMetadataSources()