Skip navigation.

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 ivyconf file.

Child elements

Element Description Cardinality
any resolver adds 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:

Name Type Description
IvyRep Standard Finds ivy files on ivyrep and artifacts on ibiblio.
IBiblio Standard Finds artifacts on ibiblio.
FileSystem Standard This very performant resolver finds ivy files and artifacts in your file system.
Url Standard Finds ivy files and artifacts in any repository accessible with urls.
Vfs Standard Finds ivy files and artifacts in any repository accessible with apache commons vfs.
ssh Standard Finds ivy files and artifacts in any repository accessible with ssh.
sftp Standard Finds ivy files and artifacts in any repository accessible with sftp.
Chain Composite Delegates the finding to a chain of sub resolvers.
Dual Composite Delegates 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:

Attribute Description Required Composite Standard
name the name which identify the resolver Yes Yes Yes
validate indicates if resolved ivy files should be validated against ivy xsd No, defaults to call setting Yes Yes
checkmodified Indicates 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
changingPattern Indicates for which revision pattern this resolver should check lastmodified date to know if an artifact file is up to date. since 1.4 No, defaults to none Yes Yes
changingMatcher The name of the pattern matcher to use to match a revision against the configured changingPattern. since 1.4 No, defaults to exactOrRegexp Yes Yes
alwaysCheckExactRevision Indicates 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
namespace The name of the namespace to which this resolver belong since 1.3 No, defaults to 'system' Yes Yes
checkconsistency true to check consistency of module descriptors found by this resolver, false to avoid consistency check since 1.3 No, defaults to true No Yes
allownomd true 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
checksums a comma separated list of checksum algorithms to use both for publication and checking since 1.4 No, defaults to ${ivy.checksums} No Yes
latest The name of the latest strategy to use. No, defaults to 'default' Yes Yes

Examples

<resolvers>
  <filesystem name="1">
    <ivy pattern="${ivy.conf.dir}/1/[organisation]/[module]/ivys/ivy-[revision].xml"/>
    <artifact pattern="${ivy.conf.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).