0

I have 3 modules A, B, C. A has a compile/default dependency on B, B has a test dependency on C and C has a compile/default dependency on A.

Maven detects this as a cycle, but only B's tests (not non-test code) are dependent on C and neither C nor A are dependent on B's tests.

Is there a reason why maven still detects this as a cycle? Is there a way to resolve it?

user1991839
  • 1,993
  • 2
  • 14
  • 11

1 Answers1

0

You can break up your one of your projects in api and implementation.

You could create a B-api project. Link A against B-api for compilation. You can add B as a runtime dependency if required. That should get you out of the loop.

The B-api project should provide interfaces that a implemented by B. You would code against the interfaces and wire it against the implementation at runtime.

Udo Held
  • 12,314
  • 11
  • 67
  • 93