resolve
The resolve task actually resolve dependencies described in an ivy file, 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:
- ivy.organisation
- ivy.module
- ivy.revision
- ivy.resolved.configurations
set to the organisation name found in the ivyfile which was used for resolve
set to the module name found in the ivyfile which was used for resolve
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
set to the comma separated list of configurations resolved
An additional property is set to true if there are changes since the last resolve, and to false otherwise: ivy.deps.changed
(since 1.2)
When ivy has finished the resolve task, it outputs a summary of what has been resolved. This summary looks like this:
--------------------------------------------------------------------- | | modules || artifacts | | conf | number| search|dwnlded|evicted|| number|dwnlded| --------------------------------------------------------------------- | default | 4 | 0 | 0 | 0 || 4 | 0 | ---------------------------------------------------------------------
This table gives some statistics about the dependency resolution. Each line correspond to a configuration resolved. Then the table is divided in two parts:
- modules
- number
- search
- downlded
- evicted
- artifacts
- number
- dwnlded
This is the total number of dependency modules resolved in this configuration, including transitive ones
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)
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.
This is the number of dependency module evicted by conflict managers.
This is the total number of artifacts resolved in the given configuration.
This is the number of artifacts actually downloaded from the repository.
since 1.4 A new 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 a 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.
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 "ivy.resolved.descriptor"
.
Attribute | Description | Required |
---|---|---|
file | path to the ivy file to use for resolution | No. Defaults to ${ivy.dep.file} or nothing in inline mode |
conf | a comma separated list of the configurations to resolve | No. Defaults to ${ivy.configurations} |
useOrigin | true to avoid the copy of local artifacts to the cache and use directly their original location, false otherwise since 1.4. To know if an artifact is local ivy asks to the resolver. Only filesystem resolver is considered local by default, but this can be disabled if you want to force the copy on one filesystem resolver and use the original location on another. Note that it is safe to use useOrigin even if you some no local resolvers, Ivy will behave as usual in this case. Note also that this only applies to artifacts, not to ivy files, which are still copied in the cache. |
No. defaults to false |
inline | true to use inline mode, false to resolve an ivy file since 1.4 | No. defaults to false |
organisation | the organisation of the module to resolve in inline mode since 1.4 | Yes in inline mode, no otherwise. |
module | the name of the module to resolve in inline mode since 1.4 | Yes in inline mode, no otherwise. |
revision | the revision constraint to apply to the module to resolve in inline mode since 1.4 | No. Defaults to "latest.integration" in inline mode, nothing in standard mode. |
type | comma separated list of accepted artifact types (since 1.2) | No. defaults to ${ivy.resolve.default.type.filter} |
haltonfailure | true to halt the build on ivy failure, false to continue | No. Defaults to true |
failureproperty | the name of the property to set if the resolve failed since 1.4 | No. No property is set by default. |
transitive | true to resolve dependencies transitively, false otherwise since 1.4 | No. Defaults to true |
showprogress | true to show dots while downloading, false otherwise | No. Defaults to true |
validate | true to force ivy files validation against ivy.xsd, false to force no validation | No. Defaults to default ivy value (as configured in configuration file) |
Examples
<ivy:resolve file="path/to/ivy.xml"/>
Resolve all dependencies declared in path/to/ivy.xml file.
<ivy:resolve file="path/to/ivy.xml" transitive="false" />
Same as above, but with transitive dependencies disabled.
<ivy:resolve file="path/to/ivy.xml" conf="default, test"/>
Resolve the dependencies declared in the configuration default and test of the path/to/ivy.xml file.
<ivy:resolve file="path/to/ivy.xml" type="jar"/>
Resolve all dependencies declared in path/to/ivy.xml file, but download only jar artifacts.
<ivy:resolve organisation="apache" module="commons-lang" revision="2+" inline="true" />
Resolve the commons-lang module revision 2+ from the repository, with its dependencies.