19
votes

From Elixir documentation:

:applications - all applications your application depends on at runtime. By default, this list is automatically inferred from your dependencies. Any extra Erlang/Elixir dependency must be specified in :extra_applications. Mix and other tools use the application list in order to start your dependencies before starting the application itself.

:extra_applications - a list of Erlang/Elixir applications that you want started before your application. For example, Elixir’s :logger or Erlang’s :crypto.

If the list for :applications is automatically inferred, then what are some example scenarios when we should add an application to :applications instead of :extra_applications? and vice versa?

1

1 Answers

23
votes

If you use applications then no inference is done and extra_applications are not considered. When applications are not provided, they are set to something like this:

applications_inferred_from_deps ++ extra_applications

You use one or the other, but never both.