<commit_before>---
title: Version handling
---

This page aims at describing how versions are reconciled in coursier,
in particular when version intervals are involved.

## Reconciliation

Version reconciliation happens when two or more of your direct or
transitive dependencies depend on different versions of the same module.
Version reconciliation then either chooses one version for that module, or
reports a conflict if it can't reconcile those versions.

### Algorithm

Version reconciliation is handed several:
- specific versions, like `1.2.3` or `2.0.0-M2`, and / or
- version intervals, like `[1.0,2.0)` or `2.0+`.<commit_msg>Tweak version handling page<commit_after>---
title: Version handling
---

This page aims at describing how versions are reconciled and compared
in coursier, in particular when version intervals are involved.

## Reconciliation

Version reconciliation happens when two or more of your direct or
transitive dependencies depend on different versions of the same module.
Version reconciliation then either chooses one version for that module, or
reports a conflict if it can't reconcile those versions.

Note that the depth of a dependency in the dependency graph doesn't matter
here. All versions of a module, wherever they come from in the dependency
graph, are handled and compared on an equal footing. coursier somehow
follows a "latest win" strategy, [like Ivy](https://github.com/coursier/coursier/issues/418#issuecomment-487800709), where the highest of two versions
usually ends up being selected, whatever its origin in the dependency graph.

### Algorithm

Version reconciliation is handed several:
- specific versions, like `1.2.3` or `2.0.0-M2`, and / or
- version intervals, like `[1.0,2.0)` or `2.0+`.
{'fraction_non_alphanumeric': 0.07040641099026904, 'fraction_numerical': 0.021751574127074985, 'mean_word_length': 4.638709677419355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1345758', 'n_tokens_mistral': 464, 'n_tokens_neox': 439, 'n_words': 234}