I have this structure
**** child C
Parent (A)
**** child B
If I try to install child B without the parent, maven throws me an error, I know by convention I should have the parent installed in my repository, but is there any way for someone to pull the child and during the install process, install the Parent automatically?
@edit
I'm going to try to be clearer, I have a project B that depends on project A (Project A is parent, same as in project B) I would like to be able to build in project B without needing the existence of A in my ' Local '(m2> repository) Repository, I would like some way, from B also install A, so that a developer who will act on B does not have to manually install A before
Long story short: No. (Not directly, at least.)
You can't run a build of a project from another one (but from an aggregator/multi-module project or with the Maven Invoker Plugin or a Groovy or Ant script or the like. But at the time you'd perform one of the latter in your case the dependency resolution would have been done already, and would have failed.)
You can do it the other way round like:
+- aggregator
+- pom.xml: <packaging>pom, <module>parent (A), <module>child B
|
+- parent (A)
| +- pom.xml
|
+- child B
| +- pom.xml: <parent>parent (A), <relativePath>../parent (A), <dependency>parent (A)
|
+- child C
+- pom.xml: <parent>parent (A), <relativePath>../parent (A)
Building aggregator
builds parent (A)
and child B
in that order since the Maven Reactor recognizes the dependency of child B
on parent (A)
.