0

I have a spring web mvc project with gradle build tools. It is running perfectly fine. but I want to use swagger to generate open api documentation for it. So , I have used implementation 'org.springdoc:springdoc-openapi-ui:1.5.2'.

But as soon i add this, it causing import problem.
import org.springframework.web.servlet.view.document.AbstractExcelView;

why including spring-doc open ui causing this? Without this dependency AbstractExcelView class is available.

1 Answers1

0

When you include a new dependency in your project, it can sometimes conflict with other dependencies if they use different versions of the same library. In this case, it looks like the spring-doc-openapi-ui is using a different version of the Spring framework than the one that your project is using

tisho
  • 106
  • 4
  • How to resolve then this? – Upendra Kumar Dec 05 '22 at 11:18
  • Either specify compatible versions of spring-webmvc and spring-doc-openapi-ui in your gradle file or you can exclude the spring-webmvc dependency from the spring-doc-openapi-ui dependency in your build configuration. This will allow your project to use its own version of the spring-webmvc library instead of the one included in the spring-doc-openapi-ui dependency.Like that: dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springdoc:springdoc-openapi-ui:1.5.2' { exclude group: 'org.springframework', module: 'spring-webmvc' } } – tisho Dec 05 '22 at 12:58
  • Yes this has helped me to solve this dependency problem, but now i am stuck on circular bean creation problem. Anyway very thanks @tisho for suggestions. – Upendra Kumar Dec 05 '22 at 17:54