Does maven support module dependencies from two sides?

I have a crawler-core module, and a crawler-module. I need to run some crawler-module methods from crawler-core. And the crawler-module methods must also call the crawler-core methods.

And at the same time adding the crawler-module dependency to the crawler-core, also the crawler-core to the crawler-module, an error occurs during the execution of the main method which is in the crawler-core module. Mistake:

Error: java: annotation Please ensure that all modules from cycle [crawler-core, olx-module] are excluded from annotation processing

How can this problem be solved ? Maybe this is a bad project design and you need to do something different?

  • one
    Maybe this is a bad project design - if they depend on each other, they may be a single whole. Cyclic dependencies are usually considered a sign of poor design, yes. - D-side

1 answer 1

Maven cannot resolve circular dependencies. You yourself need to get rid of them. There are several strategies to do this: merge into one project, or vice versa, bring the common part into a separate component, on which the other modules will depend.