Working with dependencies in the Hex ecosystem

For the Hex ecosystem (Erlang, Elixir, Gleam), Johnny supports the following package managers:

rebar3 (Erlang)

Using the rebar.config file

Johnny analyzes the main project manifest rebar.config, which contains dependency descriptions.

Using the rebar.lock file

  1. Compile the project with dependency download:

    rebar3 compile
  2. Lock dependency versions:

    rebar3 lock

A rebar.lock file will be created with locked versions.

Creating a rebar3-tree.txt file

To obtain the full dependency tree, run:

rebar3 tree > rebar3-tree.txt

If a rebar3-tree.txt file is present, Johnny uses it directly. When the --rebar-resolve flag is used, Johnny runs rebar3 tree automatically and parses the output in memory.

Dependency resolution via rebar3

Johnny supports dependency resolution for Erlang projects with the --rebar-resolve flag.

mix (Elixir)

Using the mix.exs file

Johnny analyzes the main project manifest mix.exs, which contains dependency descriptions.

Using the mix.lock file

  1. Get dependencies:
    mix deps.get

The mix.lock file will be created or updated.

Dependency resolution via mix

Johnny supports dependency resolution for Elixir projects with the --mix-resolve flag.

gleam (Gleam)

Using the gleam.toml file

Johnny analyzes the main project manifest gleam.toml, which contains dependency descriptions.

Using the manifest.toml file

  1. Download dependencies:
    gleam deps download

The manifest.toml file in the build/packages directory will be updated.

Dependency resolution via gleam

Johnny supports dependency resolution for Gleam projects with the --gleam-resolve flag.

Was this page helpful?