I’m using Maven for a project where one child project depends on another child project. When I do a mvn clean install, it builds them in the correct order (first the dependency, then the project that needs it), but in the project with the dependency, it downloads it from a remote repo instead of using the one I just built.
Looking at my logs, I see that it’s not installing the dependency, even though I’m using the install target. EDIT: It does install some of the dependencies, just not the one I want.
How do I fix this?
It turns out that Maven installs modules in the order that they’re defined in the superpom.
Mine was like this:
Giving us this build order:
module-b(as a dependency)module-amodule-amodule-bSince
module-bisn’t installed at step 2, it downloadsmodule-bfrom the remote repo, and then the build fails since it’s the wrong version.