ant-ivy/doc/configuration/caches.html

80 lines
4.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<script type="text/javascript">var xookiConfig = {level: 1};</script>
<script type="text/javascript" src="../xooki/xooki.js"></script>
</head>
<body>
<textarea id="xooki-source">
<b>Tag:</b> caches
Defines the list of available repository cache instances. <span class="since">since 2.0</span>.
By default, Ivy defines one repository cache instance, called 'default-cache', and using the defaults cache settings defined using attributes on this tag. This default instance is defined as long as you don't define your own default cache using the 'default' attribute, and have at least one dependency resolver which doesn't specify which cache instance to use.
Since repository cache implementation are pluggable, you can either define new cache instances based on the default implementation provided in Ivy using the cache child element, or use custom cache implementations using child elements as you have defined using [[configuration/typedef]].
<em>ivyPattern</em> and <em>artifactPattern</em> are used to configure the default way Ivy stores ivy files and artifacts in repository cache(s). 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 base directory.
<h1>Attributes</h1>
<table class="ivy-attributes">
<thead>
<tr><th class="ivy-att">Attribute</th><th class="ivy-att-desc">Description</th><th class="ivy-att-req">Required</th></tr>
</thead>
<tbody>
<tr><td>default</td><td>the name of the default cache to use on all resolvers not defining the cache instance to use</td>
<td>No, defaults to a default cache manager instance named 'default-cache'</td></tr>
<tr><td>basedir</td><td>the path of the default directory to use to put repository cache data. <strong>This should not point to a directory used as a repository!</strong></td>
<td>No, defaults to defaultCache defined in [[configuration/conf]]</td></tr>
<tr><td>ivyPattern</td><td>default pattern used to indicate where ivy files should be put in the repository cache(s)</td>
<td>No, defaults to [organisation]/[module]/ivy-[revision].xml</td></tr>
<tr><td>artifactPattern</td><td>default pattern used to indicate where artifact files should be put in repository cache(s)</td>
<td>No, defaults to [organisation]/[module]/[type]s/[artifact]-[revision].[ext]</td></tr>
<tr><td>lockStragegy</td><td>the name of the default [[configuration/lock-strategies lock strategy]] to use when accessing repository cache(s)</td>
<td>No, defaults to <em>no-lock</em></td></tr>
</tbody>
</table>
<h1>Child elements</h1>
<table class="ivy-children">
<thead>
<tr><th class="ivy-chld">Element</th><th class="ivy-chld-desc">Description</th><th class="ivy-chld-card">Cardinality</th></tr>
</thead>
<tbody>
<tr><td><a href="caches/cache.html">cache</a></td><td>defines a new repository cache instance, based on the default repository cache implementation</td>
<td>0..n</td></tr>
<tr><td><em>any cache</em></td><td>defines a new repository cache instance</td>
<td>0..n</td></tr>
</tbody>
</table>
<h1>Examples</h1>
<code type="xml">
<caches>
<cache name="mycache" basedir="path/to/my/cache/1" />
<cache name="mycache2" basedir="path/to/my/cache/2" />
</caches>
</code>
Define 2 cache instances, named mycache and mycache2, using two different directories as base directory, and using the default patterns and lock strategies. The default cache instance will still be defined as long as at least one dependency resolver does not declare which cache manager to use.
<hr/></textarea>
<script type="text/javascript">xooki.postProcess();</script>
</body>
</html>