cache


Tag: cache

since 2.0 Configures the Ivy cache.

Ivy cache is composed of two different parts:
  • the repository cache
  • The repository cache is where Ivy stores data downloaded from module repositories, along with some meta information concerning these artifacts, like their original location.
    This part of the cache can be shared if you use an ad hoc lock strategy.
  • the resolution cache
  • This part of the cache is used to store resolution data, which is used by Ivy to reuse the results of a resolve process.
    This part of the cache is overwritten each time a new resolve is performed, and should never be used by multiple processes at the same time.
Here are some details on the available settings attributes:

basedir is the base directory where the cache will be stored. All other cache related paths are relative to this basedir.
It usually points to a directory in the local filesystem.
This should not point to a directory used as a repository!

Once the settings are loaded, the value of the defaultCache (either configured or the default value) is stored in an Ivy variable: ivy.cache.dir.

repositoryDir and resolutionDir are used to configure the base location of the repository and resolution parts of the cache.

repositoryIvyPattern and repositoryArtifactPattern are used to configure the way Ivy stores ivy files and artifacts in the cache. Usually you do not have to change this, unless you want to use the cache directly from another tool, which is not recommended. These patterns are relative to the repository cache root.

lockStrategy is used to define the lock strategy to use when accessing the repository cache.

Attributes

AttributeDescriptionRequired
basedira path to a directory to use as base directory for the cache. No, defaults to .ivy2/cache in user home
resolutionDirthe path of the directory to use to put all resolution cache data No, defaults to empty string (ie cache basedir)
repositoryDirthe path of the directory to use to put all repository cache data No, defaults to empty string (ie cache basedir)
repositoryIvyPatterna pattern to indicate where ivy files should be put in the repository cache No, defaults to [organisation]/[module]/ivy-[revision].xml
repositoryArtifactPatterna pattern to indicate where artifact files should be put in repository cache No, defaults to [organisation]/[module]/[type]s/[artifact]-[revision].[ext]
lockStragegythe name of the lock-strategies lock strategy to use when accessing the cache No, defaults to no-lock

Example

<cache basedir="mycache"
resolutionDir="resolution"
repositoryDir="repository"
repositoryIvyPattern="[module]/ivys/ivy-[revision].xml"
repositoryArtifactPattern="[module]/[type]s/[artifact]-[revision].[ext]"
lockStrategy="artifact-lock"
/>