How to configure annotations processing in IntelliJ IDEA 14 for current project work?
To solve these kind of problems need to use Analyze Module dependencies in InteliJ-idea.
File Menu > Analyze > Module Dependencies
This shows the list of all projects which have cyclic dependencies and should be resolved first.
This feature helps you to find the problem.
EDIT – For the latest version, it is Analyze -> Analyze Module Dependencies..
In addition to Mikhails answer, here is how to fix it:
When you saw which modules have cyclic dependencies, right-click your project and
Open Module Settings
-> Expand the according module-group and select the module -> Dependencies
-> select and remove it