说明
最近项目需要使用到swagger,目前官方还没有自己的starter使用,我们上次在文章Swagger2(starter版本)在SpringBoot下的使用使用了程序猿DD翟永超大佬写的spring-boot-starter-swagger版本来通过starter版本更快速的使用Swagger,现在我根据自己的需要也写了一个starter版本,欢迎使用和交流啊(σ゚∀゚)σ..:*☆哎哟不错哦
源码->https://github.com/Yunlingfly/swagger2-starter
引入->https://search.maven.org/artifact/cn.yunlingfly/swagger-spring-boot-starter/0.1-RELEASE/jar
使用方法戳->https://github.com/Yunlingfly/swagger2-starter#swagger-spring-boot-starter
快速开始
首先给出项目结构
新建springboot项目,更新pom.xml如下(pom详解戳我的另一篇博文->SpringBoot项目发布到Maven中央仓库)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>cn.yunlingfly</groupId>
<artifactId>swagger-spring-boot-starter</artifactId>
<version>0.1-RELEASE</version>
<name>swagger-spring-boot-starter</name>
<description>Demo project for Spring Boot</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-a