I have two maven projects:
project-api
project-impl
project-impl’s POM specifies a dependency on project-api. The top level aggregation pom lists modules project-api and project-impl.
If I run compile at top level, the dependencies resolves correctly. If I run compile at project-impl, then it can’t find dependency project-api. How can I set up maven such that when project-impl compiles, it first compiles and collects its dependencies on other projects?
you can only do that from the root project
this will build your sub project and also all dependencies in the same tree. in general, when you have a multi module project, you should always build from the parent, never from the child. And if you only want to build one or two child projects, do this:
OR
(projects child2 and child3 are build, but child1 and child4 aren’t)