Hi yoahn 개발블로그

[springboot] swagger 연동하기 본문

Framework & Library/springboot

[springboot] swagger 연동하기

hi._.0seon 2021. 4. 20. 15:49
반응형

memostack.tistory.com/17

 

Gradle 환경에서 Spring Boot 에 Swagger 2 적용하기

1. Dependency 적용 build.gradle 에 swagger2 를 추가한다. (https://mvnrepository.com/artifact/io.springfox/springfox-swagger2/2.9.2) dependencies { ... // Swagger 2 compile group: 'io.springfox', na..

memostack.tistory.com

개발환경

IntelliJ

Spring Boot : 2.4.4

JAVA 11

Gradle

 

위의 블로그를 보고 따라했는데, 오류가 계속 나서 뭔가 하고 열심히 찾아봤는데 

stackoverflow.com/questions/60710084/the-following-method-did-not-exist-org-springframework-plugin-core-pluginregis

 

The following method did not exist: 'org.springframework.plugin.core.PluginRegistry org.springframework.plugin.core.PluginRegist

pom.xml org.springframework.boot spring-boot-starter-data-jpa

stackoverflow.com

 

버전이 맞지 않아서 생기는 문제였다...

build.gradle 에서 dependencies 부분에

compile 'io.springfox:springfox-swagger2:3.0.0'
compile 'io.springfox:springfox-swagger-ui:2.9.2'

Swagger 설정 파일을 작성하면 현재까지 작성된 컨트롤러를 바탕으로 api문서가 나오고,

스웨거 문서를 통한 API 테스트도 가능하다

반응형

'Framework & Library > springboot' 카테고리의 다른 글

[springboot] Exception 처리  (0) 2021.05.12
[springboot] Spring-Data-JPA Paging 기능  (0) 2021.04.24
[spring] mysql 설치하기  (0) 2021.02.06
[Spring] #8 AOP  (0) 2021.01.29
[Spring] #7 스프링 DB 접근 기술 2  (0) 2021.01.27
Comments