Does it matter in which child app of a Phoenix umbrella app I specify dependencies?

I’m new to Elixir and Phoenix. After reading “Programming Phoenix” I created an umbrella app for a new Phoenix project. I have a child app for my contexts and database related stuff (let’s call it “project”) and another child app for the web-facing stuff (let’s call it “project_web”).

After working with it for a while I noticed that it doesn’t seem to matter in which of the mix.exs files I add my dependencies. For example I accidentally added a dependency that code in “project_web” depends on to the mix.exs file for “project” and still everything worked as expected.

This leads me to my question: Does it matter where I specify my dependencies? What are the best practices around this? I assume that it starts to matter if I want to deploy the child apps separately. Is there a way to enforce the “correct” location (i.e. force me to specify dependencies in the child app that actually needs them)?

Hello and welcome,

In an umbrella, it’s not so important because all dependencies ends up at the root of umbrella projects.

But You can always change to put deps in the right mix.exs.