SpringBoot——》整合knife4j详细步骤
一、在maven项目的pom.xml中引入Knife4j的依赖包
1、Knife4j本身已经引入了springfox,不用再单独引入Springfox的具体版本,否则会导致版本冲突。
2、使用Knife4j2.0.6及以上的版本,Spring Boot的版本必须大于等于2.2.x
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<!--在引用时请在maven中央仓库搜索2.X最新版本号-->
<version>2.0.8</version>
</dependency>
二、创建Swagger配置依赖
import io.swagger.annotations.ApiOperation;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation