Liferay 7.4 circular dependency detected by gradle

104 Views Asked by At

I want to use multiple projects in Liferay 7.4 and am facing a circular dependency issue:

  • Project A depends on Project B and
  • Project B depends on Project A.

When we add these dependencies in build.gradle it shows a circular dependency error in the build.

How do I fix this?

1

There are 1 best solutions below

0
Olaf Kock On

The typical way to resolve circular dependencies is to extract a third module, typically an API module with just interfaces (maybe some utility classes), and have both existing modules depend on it rather than on each other.

Another (less popular) option is to merge both projects into one. Quite brute force, but technically solves the same problem.