Mainly in [Definitions.scala](https://github.com/coursier/coursier/blob/master/core/shared/src/main/scala/coursier/core/Definitions.scala), [Resolution.scala](https://github.com/coursier/coursier/blob/master/core/shared/src/main/scala/coursier/core/Resolution.scala), and [ResolutionProcess.scala](https://github.com/coursier/coursier/blob/master/core/shared/src/main/scala/coursier/core/ResolutionProcess.scala).
Uniquely designates a... module. Typically, just an organisation (`org.scala-lang`) and a name (`scala-library`). At times, can also contains so called attributes: (unordered) key-value pairs. E.g. the SBT plugins usually have some, like `scalaVersion` with value `2.10` and `sbtVersion` with value `0.13`.
Two modules having different organisation / name / attributes are simply considered different.
During resolution, all dependencies with the same module have their versions reconciled if possible. If not possible, we have a version conflict (conflicting versions of a module are needed), which makes the resolution fail.
Usually comes from a POM file (Maven) or an `ivy.xml` file (Ivy). In the former case, the infos in `Project` may originate from several POMs, if the main one has a parent POM, or some import dependencies. Raw `Project`s are obtained from the various individual POMs, and merged back into one (done during resolution by `Resolution` - TODO give more details).
Proceeds with the resolution per se, starting from an initial state (a `Resolution` instance), until the final one.
Goes from one state to another by determining whether the current state:
- needs some extra metadata about some versions of some modules (some IO is needed, with a cache and/or repositories), or
- needs to take into account previously fed metadata (just calculations, no IO, giving the next state).
So each step is either IO or calculations. Several IO steps can occur in a row, if some parent POMs or dependency imports are needed to get the full picture about a given module. A calculation step is either the last step, or followed by some IO. So the steps are like: IO, IO, IO, calculations, IO, IO, calculations, IO, calculations -> done. The last step is necessarily some calculations (IO can't end it - the newly fetched metadata of an IO step needs to be taken into account by a calculation step).
TODO Describe ResolutionProcess a bit more...
### Artifacts
Once the resolution is done, we get the final `Resolution`. This `Resolution`can provide:
- final dependency list,
- artifact list,
- dependency graph,
- ...
TODO Describe all of these a bit more
## Cache / downloading
### Fetching metadata
What we need during resolution: fetching metadata, possibly several ones at once.
TODO Describe the function to supply to `ResolutionProcess` to fetch metadata
### Resolution result: artifact list
TODO How we can fetch artifacts per se...
### Cache structure on disk
TODO More about the cache (structure on disk, error tracking, TTL tracking, locks)