A maven project has spring-boot-starter-parent as its parent. I just switched the version from 2.3.1.RELEASE to 2.6.7.
Suddenly, the springboot application that uses this project has cyclic dependencies with this error:
The dependencies of some of the beans in the application context form a cycle: org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration ┌─────┐ | com.mycompany.spring.logging.configuration.InterceptorConfiguration (field com.mycompany.spring.logging.RequestInterceptor com.mycompany.spring.logging.configuration.InterceptorConfiguration.interceptor) └─────┘ Action: Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.
No Java source has changed, no other dependencies have changed. The classes in the error (InterceptorConfiguration and RequestInterceptor) are in another internal library and they have not changed.
I'm a bit confused about what's causing the circular reference, and I'm not sure how to resolve it. Setting spring.main.allow-circular-references=true seems like a less-than-ideal solution.