resolvers


Tag: resolvers

Defines a list of dependency resolvers usable in ivy. Each dependency resolver is identified by its name, given as an attribute.

The child tag used for the dependency resolver must be equal to a name of a dependency resolver type (either built-in or added with the typedef tag).

since 1.3 Once defined, resolvers can be referenced by their name, using the following syntax:
<resolver ref="alreadydefinedresolver"/>
Note that this works only if the resolver has been already defined, and not if it is defined later in the ivysettings file.

Child elements

ElementDescriptionCardinality
any resolveradds a resolver to the list of available resolvers 1..n

Built-in Resolvers

Ivy comes with a set of built-in dependency resolvers able to answer to the most common needs.

If you don't find the one you want here, you can also check if some one has not contributed it in the links page, or even write your own.

There are basically two types of resolver in Ivy: composite and standard resolvers. A composite resolver is a resolver which delegates the work to other resolvers. The other resolvers are standard resolvers.

Here is the list of built-in resolvers:
NameTypeDescription
IvyRepStandardFinds ivy files on ivyrep and artifacts on ibiblio.
IBiblioStandardFinds artifacts on ibiblio.
FileSystemStandardThis very performant resolver finds ivy files and artifacts in your file system.
UrlStandardFinds ivy files and artifacts in any repository accessible with urls.
VfsStandardFinds ivy files and artifacts in any repository accessible with apache commons vfs.
sshStandardFinds ivy files and artifacts in any repository accessible with ssh.
sftpStandardFinds ivy files and artifacts in any repository accessible with sftp.
ChainCompositeDelegates the finding to a chain of sub resolvers.
DualCompositeDelegates the finding of ivy files to one resolver and of artifacts to another.

Common attributes

All resolvers of the same type share some common attributes detailed here:
AttributeDescriptionRequiredCompositeStandard
namethe name which identify the resolver Yes Yes Yes
validateindicates if resolved ivy files should be validated against ivy xsd No, defaults to call setting Yes Yes
checkmodifiedIndicates if this resolver should check lastmodified date to know if an ivy file is up to date. No, defaults to ${ivy.resolver.default.check.modified} No Yes
changingPatternIndicates for which revision pattern this resolver should check lastmodified date to know if an artifact file is up to date. since 1.4. See cache and change management for details. No, defaults to none Yes Yes
changingMatcherThe name of the pattern matcher to use to match a revision against the configured changingPattern. since 1.4. See cache and change management for details. No, defaults to exactOrRegexp Yes Yes
alwaysCheckExactRevisionIndicates if this resolver should check the given revision even if it's a special one (like latest.integration). since 1.3 No, defaults to ${ivy.default.always.check.exact.revision} No Yes
namespaceThe name of the namespace to which this resolver belong since 1.3 No, defaults to 'system' Yes Yes
checkconsistencytrue to check consistency of module descriptors found by this resolver, false to avoid consistency check since 1.3 No, defaults to true No Yes
allownomdtrue if the absence of module descriptor (usually an ivy file) is authorised for this resolver, false to refuse modules without module descriptor since 1.4 No, defaults to true No (except dual) Yes
checksumsa comma separated list of checksum algorithms to use both for publication and checking since 1.4 No, defaults to ${ivy.checksums} No Yes
latestThe name of the latest strategy to use. No, defaults to 'default' Yes Yes

Examples

<resolvers>
<filesystem name="1">
<ivy pattern="${ivy.settings.dir}/1/[organisation]/[module]/ivys/ivy-[revision].xml"/>
<artifact pattern="${ivy.settings.dir}/1/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
</filesystem>
<chain name="chain1">
<resolver ref="1"/>
<ivyrep name="ivyrep"/>
</chain>
<chain name="chain2" returnFirst="true" dual="true">
<resolver ref="1"/>
<ibiblio name="ibiblio"/>
</chain>
</resolvers>
Defines a filesystem resolver, named '1', which is then used in two chains, the first which seconds the filesystem resolver with an ivyrep resolver, and second which seconds the filesystem resolver with an ibiblio resolver, and which returns the first module found, and uses the whole chain to download artifacts (see corresponding resolvers documentation for details about them).