blob: 030b3aea5abe29087b1da87339f39db8088c2505 [file] [log] [blame]
<!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">
The resolve task actually resolve dependencies described in an <a href="../ivyfile.html">ivy file</a>, and put the resolved dependencies in the ivy cache.
If configure has not been called before resolve is called, a default configuration will be used (equivalent to call configure with no attributes).
After the call to this task, four properties are set in ant:
<ul>
<li>ivy.organisation</li>
set to the organisation name found in the ivyfile which was used for resolve
<li>ivy.module</li>
set to the module name found in the ivyfile which was used for resolve
<li>ivy.revision</li>
set to the revision name found in the ivyfile which was used for resolve, or a generated revision name if no revision was specified in the file
<li>ivy.resolved.configurations</li>
set to the comma separated list of configurations resolved
</ul>
<b>Since 1.2:</b>
An additional property is set to true if the resolved dependencies are changes since the last resolve, and to false otherwise: <code>ivy.deps.changed</code>
<b>Since 2.0:</b>
The property ivy.deps.changed will not be set (and not be computed) if you set the parameter <i>checkIfChanged</i> to false. (by default it is true to keep backward compatibility). This allow to optimize your build when you have multi-module build with multiple configurations.
<b>Since 2.0:</b>
In addition, if the <i>resolveId</i> attribute has been set, the following properties are set as well:
<ul>
<li>ivy.organisation.${resolveId}</li>
<li>ivy.module.${resolveId}</li>
<li>ivy.revision.${resolveId}</li>
<li>ivy.resolved.configurations.${resolveId}</li>
<li>ivy.deps.changed.${resolveId}</li>
</ul>
<b>Since 2.4</b>
If current module extends other modules
<ul>
<li>ivy.parents.count</li>
number of parents module
<li>ivy.parent[index].organisation</li>
set to the organisation name found in the parent ivyfile which was used for resolve
<li>ivy.parent[index].module</li>
set to the module name found in the parent ivyfile which was used for resolve
<li>ivy.parent[index].revision</li>
set to the revision name found in the parent ivyfile which was used for resolve
<li>ivy.parent[index].branch</li>
set to the branch name found in the parent ivyfile which was used for resolve
</ul>
Where <i>index</i> represent the index of extends module.
When ivy has finished the resolve task, it outputs a summary of what has been resolved. This summary looks like this:
<pre>
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| default | 4 | 0 | 0 | 0 || 4 | 0 |
---------------------------------------------------------------------
</pre>
This table gives some statistics about the dependency resolution. Each line correspond to a configuration resolved. Then the table is divided in two parts:
<ul>
<li>modules</li>
<ul>
<li>number</li>
This is the total number of dependency modules resolved in this configuration, including transitive ones
<li>search</li>
This is the number of dependency modules that required a repository access. The repository access is needed if the module is not yet in cache, or if a latest version is required, or in some other cases (depending on checkModified, for instance)
<li>dwnlded</li>
This is the number of dependency ivy files downloaded from the repository. This number can be less than the total number of modules even with a clean cache, if no ivy file is provided for some dependencies.
<li>evicted</li>
This is the number of dependency module evicted by conflict managers.
</ul>
<li>artifacts</li>
<ul>
<li>number</li>
This is the total number of artifacts resolved in the given configuration.
<li>dwnlded</li>
This is the number of artifacts actually downloaded from the repository.
</ul>
</ul>
<h2>Inline mode</h2>
<span class="since">since 1.4</span> The inline mode allow to call a resolve without an ivy file, by setting directly the module which should be resolved from the repository. It is particularly useful to install released software, like an ant task for example. When inline is set to true, the organisation module and revision attributes are used to specify which module should be resolved from the repository.
<b>Remark:</b> if you want the standard ivy properties to be set or to reuse the results of an inline resolve by other post-resolve tasks like retrieve, cachepath, report, ..., you must set the keep attribute to true!
<h2>Resolve mode</h2>
<span class="since">since 2.0</span> The resolve mode allows to define how Ivy should use dependency revision constraints when performing the resolution.
Two modes are available:
<ul>
<li>default</li> In this mode the default revision constraint (expressed with the rev attribute in the [[ivyfile/dependency]] element) is used.
<li>dynamic</li> In this mode the dynamic revision constraint (expressed with the revConstraint attribute in the [[ivyfile/dependency]] element) is used.
</ul>
<h2>Concurrency</h2>
During resolve, Ivy creates a file in the [[settings/caches resolution cache]]. The creation of this file is not aimed to support concurrency, meaning that you can't have two concurrent resolve of the same module, in the same resolution cache, with the same resolveId.
<i>Note for developers:
After the call to this task, a reference to the module descriptor resolved is put in the ant project under the id <code>"ivy.resolved.descriptor"</code>.</i>
<h1>Attributes</h1>
<table class="ant">
<thead>
<tr><th class="ant-att">Attribute</th><th class="ant-desc">Description</th><th class="ant-req">Required</th></tr>
</thead>
<tbody>
<tr><td>file</td><td>path to the ivy file to use for resolution</td>
<td>No. Defaults to ${ivy.dep.file} or nothing in inline mode</td></tr>
<tr><td>conf</td><td>a comma separated list of the configurations to resolve, or '*'.
<span class="since">Since 2.0</span>, you can also use '*(private)', '*(public)'. Note that when inline is true, the configuration '*' is equivalent as '*(public)'.</td><td>No. Defaults to ${ivy.configurations}</td></tr>
<tr><td>refresh</td><td>true to force Ivy to resolve dynamic revision in this resolve process, false to use cached resolved revision <span class="since">since 2.0</span></td><td>No. defaults to false</td></tr>
<tr><td>resolveMode</td><td>the resolve mode to use for this dependency resolution process <span class="since">since 2.0</span></td><td>No. defaults to using the resolve mode set in the [[settings settings]]</td></tr>
<tr><td>inline</td><td>true to use inline mode, false to resolve an ivy file <span class="since">since 1.4</span></td><td>No. defaults to false</td></tr>
<tr><td>keep</td><td>true to keep the results of the resolve in memory, false to discard them. When this is false, the standard ivy properties won't be set and other postresolve-tasks (like retrieve and cachepath) won't be able to resuse the results of this resolve!</td><td>No. defaults to false for an inline resolve and to true in any other case</td></tr>
<tr><td>organisation</td><td>the organisation of the module to resolve in inline mode <span class="since">since 1.4</span></td><td>Yes in inline mode, no otherwise.</td></tr>
<tr><td>module</td><td>the name of the module to resolve in inline mode <span class="since">since 1.4</span></td><td>Yes in inline mode, no otherwise.</td></tr>
<tr><td>revision</td><td>the revision constraint to apply to the module to resolve in inline mode <span class="since">since 1.4</span></td><td>No. Defaults to "latest.integration" in inline mode, nothing in standard mode.</td></tr>
<tr><td>branch</td><td>the name of the branch to resolve in inline mode <span class="since">(since 2.1.0)</span></td><td>Defaults to no branch in inline mode, nothing in standard mode.</td></tr>
<tr><td>changing</td><td>indicates that the module may change when resolving in inline mode. See <a href="../concept.html#change">cache and change management</a> for details. Ignored when resolving in standard mode. <span class="since">(since 1.4)</span></td><td>No. Defaults to false.</td></tr>
<tr><td>type</td><td>comma separated list of accepted artifact types (<span class="since">since 1.2</span>)</td><td>No. defaults to ${ivy.resolve.default.type.filter}</td></tr>
<tr><td>haltonfailure</td><td>true to halt the build on ivy failure, false to continue</td><td>No. Defaults to true</td></tr>
<tr><td>failureproperty</td><td>the name of the property to set if the resolve failed <span class="since">since 1.4</span></td><td>No. No property is set by default.</td></tr>
<tr><td>transitive</td><td>true to resolve dependencies transitively, false otherwise <span class="since">since 1.4</span></td><td>No. Defaults to true</td></tr>
<tr><td>showprogress</td><td>true to show dots while downloading, false otherwise</td><td>No. Defaults to true</td></tr>
<tr><td>validate</td><td>true to force ivy files validation against ivy.xsd, false to force no validation</td><td>No. Defaults to default ivy value (as configured in configuration file)</td></tr>
<tr><td>settingsRef</td><td>A reference to the ivy settings that must be used by this task <span class="since">(since 2.0)</span></td><td>No, 'ivy.instance' is taken by default.</td></tr>
<tr><td>resolveId</td><td>An id which can be used later to refer to the results of this resolve <span class="since">(since 2.0)</span></td><td>No, defaults to '[org]-[module]'.</td></tr>
<tr><td>log</td><td>the log setting to use during the resolve process. <span class="since">(since 2.0)</span><br/>
Available options are:
<ul><li>default</li> the default log settings, where all usual messages are output to the console
<li>download-only</li> disable all usual messages but download ones. A resolve with everything in cache won't output any message.
<li>quiet</li> disable all usual messages, making the whole resolve process quiet unless errors occur
</ul></td><td>No, defaults to 'default'.</td></tr>
<tr><td>checkIfChanged</td><td>When set to true, the resolve will compare the result with the last resolution done on this module, with those configurations in order to define the property ivy.deps.changed. Put it to false may provides slightly better performance. <span class="since">(since 2.0)</span></td><td>No, default to 'true'</td></tr>
<tr><td>useCacheOnly</td><td>When set to true, it forces the resolvers to only use their caches and not their actual contents.<span class="since">(since 2.0)</span></td><td>No, default to 'false'</td></tr>
</tbody>
</table>
<h1>Child elements</h1>
<b><i>(Since 2.3)</i></b>
These child elements are defining an inlined ivy.xml's <a href="../ivyfile/dependencies.html">dependencies</a> elements. Thus these child elements cannot be used together with the <i>inline</i> or <i>file</i> attributes.
There is one important difference with the ivy.xml's <a href="../ivyfile/dependencies.html">dependencies</a>: there is no master configuration to handle here. There is actually only one, the one on which the resolve will run. So every attribute in <a href="../ivyfile/dependency.html">dependency</a>, <a href="../ivyfile/exclude.html">exclude</a>, <a href="../ivyfile/override.html">override</a> or <a href="../ivyfile/conflict.html">conflict</a> which is about a master configuration is not supported. And every attribute about a mapping of a master configuration on a dependency configuration is now expecting only the dependency configuration.
<table class="ant">
<thead>
<tr><th class="ant-att">Element</th><th class="ant-desc">Description</th><th class="ant-req">Cardinality</th></tr>
</thead>
<tbody>
<tr><td><a href="../ivyfile/dependency.html">dependency</a></td><td>declares a dependency to resolve</td>
<td>0..n</td></tr>
<tr><td><a href="../ivyfile/exclude.html">exclude</a></td><td>excludes artifacts, modules or whole organizations from the set of dependencies to resolve</td>
<td>0..n</td></tr>
<tr><td><a href="../ivyfile/override.html">override</a></td><td>specify an override mediation rule, overriding the revision and/or branch requested for a transitive dependency <span class="since">since 2.0</span></td>
<td>0..n</td></tr>
<tr><td><a href="../ivyfile/conflict.html">conflict</a></td><td>specify a a conflict manager for one or several dependencies <span class="since">since 2.0</span></td>
</tbody>
</table>
<h1>Examples</h1>
<code type="xml">
<ivy:resolve file="path/to/ivy.xml"/>
</code>
Resolve all dependencies declared in path/to/ivy.xml file.
<hr/>
<code type="xml">
<ivy:resolve file="path/to/ivy.xml" transitive="false" />
</code>
Same as above, but with transitive dependencies disabled.
<hr/>
<code type="xml">
<ivy:resolve file="path/to/ivy.xml" conf="default, test"/>
</code>
Resolve the dependencies declared in the configuration default and test of the path/to/ivy.xml file.
<hr/>
<code type="xml">
<ivy:resolve file="path/to/ivy.xml" type="jar"/>
</code>
Resolve all dependencies declared in path/to/ivy.xml file, but download only jar artifacts.
<hr/>
<code type="xml">
<ivy:resolve organisation="apache" module="commons-lang" revision="2+" inline="true" />
</code>
Resolve the commons-lang module revision 2+ from the repository, with its dependencies.
<hr/>
<code type="xml">
<ivy:resolve>
<dependency org="apache" name="commons-lang" rev="2+" />
<dependency org="apache" name="commons-logging" rev="1.1" />
<exclude org="apache" module="log4j" />
</ivy:resolve>
</code>
Resolve of both commons lang and commons logging, with their dependencies but not log4j.
<hr/>
<code type="xml">
<ivy:resolve>
<dependency org="org.slf4j" module="slf4j" rev="1.6" conf="api,log4j" />
</ivy:resolve>
</code>
Resolve the configurations "api" and "log4j" of "slf4j".
</textarea>
<script type="text/javascript">xooki.postProcess();</script>
</body>
</html>