A dependency is a component, resource, or prerequisite that another software component relies on. In an Elixir project, external dependencies are declared in mix.exs and resolved by Mix. section 11.2.1 section 11.1.1
A practical dependency workflow includes:
- Declare a library as a tuple containing its application atom and version requirement. section 11.2.1
- Fetch dependencies with mix deps.get; Mix resolves recursive dependencies and records exact versions in mix.lock. section 11.2.1
- Prefer a library that provides the needed abstraction: plug_cowboy exposes Plug while hiding Cowboy’s server details, including both transitively. section 11.3.1
- Compile the project and its dependencies with mix compile. section 11.2.1
Declaring Poolboy
defp deps do [{:poolboy, "~> 1.5"}] end The requirement accepts version 1.5 and later 1.x releases. Mix can compile Poolboy even though it is an Erlang library. section 11.2.1
Listing 11.8 External dependencies for the web server (todo_web/mix.exs)
defmodule Todo.Mixfile do
...
defp deps do
[
{:poolboy, "~> 1.5"},
{:plug_cowboy, "~> 2.6"} #1
]
end
end
Use this configuration to compare direct declarations with automatically resolved transitive dependencies. section 11.3.1


























