Package: org.gradle.api.artifacts.repositories

## [Java] Interface IvyArtifactRepository

- org.gradle.api.artifacts.repositories.IvyArtifactRepository

- All Superinterfaces:
    AuthenticationSupported, ArtifactRepository

  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 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 RepositoryHandler.ivy group of methods.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `String` | `GRADLE_ARTIFACT_PATTERN` |
    `String` | `GRADLE_IVY_PATTERN` |
    `String` | `IVY_ARTIFACT_PATTERN` |
    `String` | `MAVEN_ARTIFACT_PATTERN` |
    `String` | `MAVEN_IVY_PATTERN` |

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `artifactPattern(String pattern)` Adds an independent pattern that will be used to locate artifact files in this repository.
    `IvyArtifactRepositoryMetaDataProvider` | `getResolve()` Returns the meta-data provider used when resolving artifacts from this repository.
    `URI` | `getUrl()` The base URL of this repository.
    `void` | `ivyPattern(String pattern)` Adds an independent pattern that will be used to locate ivy files in this repository.
    `void` | `layout(String layoutName)` Specifies the layout to use with this repository, based on the root url.
    `void` | `layout(String layoutName, Action<? extends RepositoryLayout> config)` Specifies how the items of the repository are organized.
    `void` | `layout(String layoutName, groovy.lang.Closure config)` Specifies how the items of the repository are organized.
    `void` | `setUrl(Object url)` Sets the base URL of this repository.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface ArtifactRepository` | `getName, setName`
    `interface AuthenticationSupported` | `authentication, credentials, credentials, getAuthentication, getCredentials, getCredentials`

- - ### Field Detail

    - #### public String GRADLE_ARTIFACT_PATTERN

    - #### public String GRADLE_IVY_PATTERN

    - #### public String IVY_ARTIFACT_PATTERN

    - #### public String MAVEN_ARTIFACT_PATTERN

    - #### public String MAVEN_IVY_PATTERN

  - ### Method Detail

    - #### public void artifactPattern(String pattern)

      Adds an independent pattern that will be used to locate artifact files in this repository. This pattern will be used to locate ivy files as well, unless a specific ivy pattern is supplied via 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.

      Parameters:
        `pattern` - The artifact pattern.

    - #### @Incubating public IvyArtifactRepositoryMetaDataProvider getResolve()

      Returns the meta-data provider used when resolving artifacts from this repository. The provider is responsible for locating and interpreting the meta-data for the modules and artifacts contained in this repository. Using this provider, you can fine tune how this resolution happens.

      Returns:
        The meta-data provider for this repository.

    - #### public URI getUrl()

      The base URL of this repository.

      Returns:
        The URL.

    - #### public void ivyPattern(String pattern)

      Adds an independent pattern that will be used to locate ivy files in this repository. 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.

      Parameters:
        `pattern` - The ivy pattern.

    - #### public void layout(String layoutName)

      Specifies the layout to use with this repository, based on the root url. See layout(String, Closure).

      Parameters:
        `layoutName` - The name of the layout to use.

    - #### public void layout(String layoutName, Action<? extends RepositoryLayout> config)

      Specifies how the items of the repository are organized.

      The layout is configured with the supplied closure.

      Recognised values are as follows:

      #### 'gradle'

      A Repository Layout that applies the following patterns:

      - Artifacts: `$baseUri/{
        value:
          #GRADLE_ARTIFACT_PATTERN}
        `
      - Ivy: `$baseUri/{@value #GRADLE_IVY_PATTERN}`

      #### 'maven'

      A Repository Layout that applies the following patterns:

      - Artifacts: `$baseUri/{@value #MAVEN_ARTIFACT_PATTERN}`
      - Ivy: `$baseUri/{@value #MAVEN_IVY_PATTERN}`

      Following the Maven convention, the 'organisation' value is further processed by replacing '.' with '/'.

      #### 'ivy'

      A Repository Layout that applies the following patterns:

      - Artifacts: `$baseUri/{@value #IVY_ARTIFACT_PATTERN}`
      - Ivy: `$baseUri/{@value #IVY_ARTIFACT_PATTERN}`

      Note: this pattern is currently incubating.

      #### 'pattern'

      A repository layout that allows custom patterns to be defined. eg:

           repositories {
               ivy {
                   layout 'pattern' , {
                       artifact '[module]/[revision]/[artifact](.[ext])'
                       ivy '[module]/[revision]/ivy.xml'
                   }
               }
           }

      The available pattern tokens are listed as part of Ivy's Main Concepts documentation.

      Parameters:
        `layoutName` - The name of the layout to use.
        `config` - The action used to configure the layout.
      Since:
        2.3 (feature was already present in Groovy DSL, this particular method introduced in 2.3)

    - #### public void layout(String layoutName, groovy.lang.Closure config)

      Specifies how the items of the repository are organized. See layout(String, org.gradle.api.Action)

      Parameters:
        `layoutName` - The name of the layout to use.
        `config` - The closure used to configure the layout. An instance of RepositoryLayout is passed as a parameter to the closure.

    - #### public void setUrl(Object url)

      Sets the base URL of this repository. The provided value is evaluated as per Project.uri. 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, Closure) for this repository.

      Parameters:
        `url` - The base URL.