0

I have project A which depends on project B which depends on project C i need when build project A ,project B will automatically build which will automatically build project C

in project A i created a parent pom which contains module for project B

<modules>
    <module>../B</module>
</modules>

in project B another parent pom with module for project C

<modules>
    <module>../C</module>
</modules>

and finally in project A pom file i added the parent element of Project A

<parent>
    <groupId>groupId.A</groupId>
    <artifactId>artifactId.A</artifactId>
    <version>1.0</version>
    <relativePath>parent-pom.xml</relativePath>
</parent>

when build project A it always fails because it cannot see dependency B

what i need is to automat the build sequence project after project without creating aggregate project. is that possible?

root
|-- Project A
|   |-- parent-pom.xml
|   |-- pom.xml
|
|-- Project B
|   |-- parent-pom.xml
|   |-- pom.xml
|
|-- Project C
|   |-- pom.xml
|

enter image description here

Melad Basilius
  • 3,847
  • 10
  • 44
  • 81
  • Can you please show the directory structure of your projects... – khmarbaise Feb 26 '18 at 15:16
  • @khmarbaise, done – Melad Basilius Feb 26 '18 at 15:27
  • Ah..please make text instead of images..furthemore are those projects related or unrelated ? Do you checkout them from a single source (svn or git repo) ? – khmarbaise Feb 26 '18 at 15:37
  • @khmarbaise, those projects are siblings at the same parent directory and i don't use source control now . – Melad Basilius Feb 26 '18 at 15:40
  • Possible duplicate of [How to make maven build of child module with parent module?](https://stackoverflow.com/questions/27689425/how-to-make-maven-build-of-child-module-with-parent-module) – Lova Chittumuri Feb 26 '18 at 15:49
  • First using VCS is a foundation of any development so I encourage you to learn a version control system. Furthermore make a parent `pom.xml` at the root location with modules `A`, `B`and `C` and the define the dependencies between the modules by simply dependencies...afterwards you can build from top via `mvn clean package` or `mvn clean verfiy`...no need for such `parent-pom.xml` files... Example like: https://github.com/khmarbaise/javaee – khmarbaise Feb 26 '18 at 16:03

0 Answers0