An application resource file is a plain-text Erlang-term file that describes an OTP application. It records the application name, version, description, modules, dependencies, and optional startup callback module. Mix generates this file during compilation from project metadata and source modules, so it normally does not need to be written by hand. section 11.1.1
The resource connects project configuration to the running OTP system:
- Mix receives application metadata and startup configuration from mix.exs, including the application name, version, dependencies, extra applications, and callback module. section 11.1.1
- Compilation places the generated .app file with compiled .beam files in the application's ebin directory, commonly under _build/dev/lib/YourApp/ebin. section 11.1.6
- Application.start/1 reads the resource, verifies dependencies, and invokes the callback module's start/2 function; ensure_all_started/2 starts missing dependencies recursively. section 11.1.3
- System startup requires compiled modules, available .app files, BEAM load paths, and all required OTP applications. section 13.1
Generated application
Running mix new hello_world --sup creates a Mix project with an application callback module and an initially empty supervisor. Starting it with iex -S mix automatically starts hello_world and its dependencies; Application.started_applications/0 exposes the resulting set of running applications. section 11.1.1
iex(1)> Application.started_applications()
[
{:iex, ~c"iex", ~c"1.15.0"},
{:hello_world, ~c"hello_world", ~c"0.1.0"}, #1
{:logger, ~c"logger", ~c"1.15.0"},
{:mix, ~c"mix", ~c"1.15.0"},
{:elixir, ~c"elixir", ~c"1.15.0"},
{:compiler, ~c"ERTS CXC 138 10", ~c"8.3"},
{:stdlib, ~c"ERTS CXC 138 10", ~c"5.0"},
{:kernel, ~c"ERTS CXC 138 10", ~c"9.0"}
]
Inspect the running application list to verify that the generated application has started alongside its OTP and Elixir dependencies. section 11.1.1
