Can parent module have a dependencies in his own submodules?

65 Views Asked by At

Maven project structure is as follow:

moduleA
 -moduleB
 pom.xml
  • moduleA has a dependency in moduleB. moduleB actually not depend in moduleA.
  • Why I don't reverse it? make moduleB parent and moduleA child, because I can't change moduleB pom file. moduleB is a git submodule (I know I can add git repo dependency to moduleA pom file but I was told not to do it).

This structure looks wrong to me even if there is a way to make it work (is there any?). I thought to add an aggregator pom and change the structure to this:

Aggregator 
 -moduleA
 -moduleB
 pom.xml

moduleA depends in moduleB.

What do you think?

0

There are 0 best solutions below