# conflict-managers

Tag: conflict-managers

Defines a list of conflict managers usable in Ivy. Each conflict manager is identified by its name, given as an attribute. The child tag used for the conflict manager must be equal to a name of a conflict manager type (either built-in or added with the `typedef` tag).

Here is a list of built-in conflict managers (which do not require anything in the settings file):

- all
  this conflict manager resolve conflicts by selecting all revisions. Also called the `NoConflictManager`, it doesn’t evict any modules.

- latest-time
  this conflict manager selects only the `latest` revision, latest being defined as the latest in time. Note that latest in time is costly to compute, so prefer latest-revision if you can.

- latest-revision
  this conflict manager selects only the `latest` revision, latest being defined by a string comparison of revisions.

- latest-compatible
  this conflict manager selects the latest version in the conflicts which can result in a compatible set of dependencies. This means that in the end, this conflict manager does not allow any conflicts (similar to the strict conflict manager), except that it follows a best effort strategy to try to find a set of compatible modules (according to the version constraints)

- strict
  this conflict manager throws an exception (i.e. causes a build failure) whenever a conflict is found.

The two "latest" conflict managers also take into account the force attribute of the dependencies. In fact, direct dependencies can declare a force attribute (see dependency), which indicates that the revision given in the direct dependency should be preferred over indirect dependencies.

Here is a list of conflict manager types available, which can be used to define your own custom conflict managers:

- latest-cm
  The latest conflict manager uses a latest strategy to select the latest revision among several ones. Both `latest-time` and `latest-revision` conflict managers are based on this conflict manager type. It takes `latest` as attribute to define which latest strategy should be used. Example:

    <latest-cm name="mylatest-conflict-manager" latest="my-latest-strategy"/>

- compatible-cm
  The latest compatible conflict manager uses a latest strategy to select the latest revision among several ones. It takes `latest` as an attribute to define which latest strategy should be used. Example:

    <compatible-cm name="my-latest-compatible-conflict-manager" latest="my-latest-strategy"/>

- regexp-cm
  This conflict manager is based on a regular expression and throws an exception (i.e. causes a build failure) when a conflict is found with versions with different matching group. For instance, if a conflict is found between 1.2.x and 1.3.y it will throw an exception if the regular expression is `(.*)\.\d`, because the matching group will match different strings (1.2 and 1.3). 1.2.1 and 1.2.2 won’t throw an exception with the same regular expression. The regular expression is set using the `regexp` attribute. A `ignoreNonMatching` attribute can also be set to simply warn when a version is found which does not match the regular expression, instead of throwing an exception.

## Child elements

Element | Description | Cardinality
--- | --- | ---
any conflict manager | adds a conflict manager to the list of available conflict managers | 0..n