0

My project consists of 2 maven modules A and B with 3 submodules:

A

  • aApi
  • aSpec
  • aSrv

B

  • bApi
  • bSpec
  • bSrv

References:

  • A (aSrv) is using model from B (bApi)
  • B (bSrv) is using model from A (aApi)

I obviously have an error when building my project due to circular dependency (A is not building because it needs something from B and B is not building because it needs something from A). I think logically my module division makes sense but what's the best approach here for making it buildable?

  • Possible duplicate of [How to resolve cyclic dependency in Maven?](https://stackoverflow.com/questions/16468525/how-to-resolve-cyclic-dependency-in-maven) – Pino Mar 21 '19 at 09:16
  • It's a quite different scenario, in my case if we look at A and B as a whole there is a circular dependency but at the submodule perspective, there isn't. So I thought it's possible to organize somehow the build process that A and B will build properly. – Russian Gepetto Mar 21 '19 at 09:33

1 Answers1

0

If your projects are so tightly coupled, it would be best to just construct one multi-module project with all 6 modules.

In the given form, the project cannot be built. Because multi-module projects should be built completely (not just parts of it), your circular dependency is a logical problem that needs to be resolved (not just a technical one).

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142