1、POM.xml文件中添加swagger2依赖:【版本不同可能此处略有不同,自己酌情处理】
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<swagger-ui.version>2.9.2</swagger-ui.version>
<swagger2.version>2.9.2</swagger2.version>
</properties>
<!--swagger2-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger-ui.version}</version>
</dependency>
<!--排除并新增1.