将springboot项目集成到springcloud项目里面,出现了循环导入注解的错误,想请教大家如何解决?


org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: A circular @Import has been detected: Illegal attempt by @Configuration class 'SwaggerAutoConfiguration' to import class 'SwaggerAutoConfiguration' as 'SwaggerAutoConfiguration' is already present in the current import stack [SwaggerAutoConfiguration->SwaggerAutoConfiguration->RatectionRsmsApplication]
Offending resource: class path resource [com/ratection/common/swagger/config/SwaggerAutoConfiguration.class]

我把springboot项目里面的swagger2的配置删除了,还是会报这个错误,就不知道咋办,所以来到这里请教大家一下!

遇到了和楼主一样的问题,我这边的原因是启动类没加相关的注解@EnableCustomSwagger2,加上之后就不报这个错误了

移除以后 reload 然后clean一下再跑

您好,问题解决了吗?遇到了同样问题