Commit 5351917b67177f3cfc338f137e3702d0166b55e6
1 parent
b86fb4c3
引入 swagger-annotations 1.5.22 排除knife4j3.0.2 中 swagger-annotations 解决依赖冲突
Showing
2 changed files
with
14 additions
and
4 deletions
pom.xml
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <project xmlns="http://maven.apache.org/POM/4.0.0" | 2 | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 4 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | 4 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 5 | - <modelVersion>4.0.0</modelVersion> | 5 | + <modelVersion>4.0.0</modelVersion> |
| 6 | 6 | ||
| 7 | <groupId>cn.iocoder</groupId> | 7 | <groupId>cn.iocoder</groupId> |
| 8 | <artifactId>dashboard</artifactId> | 8 | <artifactId>dashboard</artifactId> |
| @@ -24,7 +24,8 @@ | @@ -24,7 +24,8 @@ | ||
| 24 | <!-- 统一依赖管理 --> | 24 | <!-- 统一依赖管理 --> |
| 25 | <spring.boot.version>2.4.2</spring.boot.version> | 25 | <spring.boot.version>2.4.2</spring.boot.version> |
| 26 | <!-- Web 相关 --> | 26 | <!-- Web 相关 --> |
| 27 | - <knife4j.version>2.0.8</knife4j.version> | 27 | + <knife4j.version>3.0.2</knife4j.version> |
| 28 | + <swagger-annotations.version>1.5.22</swagger-annotations.version> | ||
| 28 | <!-- DB 相关 --> | 29 | <!-- DB 相关 --> |
| 29 | <mysql-connector-java.version>5.1.46</mysql-connector-java.version> | 30 | <mysql-connector-java.version>5.1.46</mysql-connector-java.version> |
| 30 | <druid.version>1.2.4</druid.version> | 31 | <druid.version>1.2.4</druid.version> |
| @@ -104,8 +105,17 @@ | @@ -104,8 +105,17 @@ | ||
| 104 | <artifactId>guava</artifactId> | 105 | <artifactId>guava</artifactId> |
| 105 | <groupId>com.google.guava</groupId> | 106 | <groupId>com.google.guava</groupId> |
| 106 | </exclusion> | 107 | </exclusion> |
| 108 | + <exclusion> | ||
| 109 | + <artifactId>swagger-annotations</artifactId> | ||
| 110 | + <groupId>io.swagger</groupId> | ||
| 111 | + </exclusion> | ||
| 107 | </exclusions> | 112 | </exclusions> |
| 108 | </dependency> | 113 | </dependency> |
| 114 | + <dependency> | ||
| 115 | + <groupId>io.swagger</groupId> | ||
| 116 | + <artifactId>swagger-annotations</artifactId> | ||
| 117 | + <version>${swagger-annotations.version}</version> | ||
| 118 | + </dependency> | ||
| 109 | 119 | ||
| 110 | <!-- DB 相关 --> | 120 | <!-- DB 相关 --> |
| 111 | <dependency> | 121 | <dependency> |
src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java
| @@ -19,7 +19,7 @@ import springfox.documentation.service.SecurityScheme; | @@ -19,7 +19,7 @@ import springfox.documentation.service.SecurityScheme; | ||
| 19 | import springfox.documentation.spi.DocumentationType; | 19 | import springfox.documentation.spi.DocumentationType; |
| 20 | import springfox.documentation.spi.service.contexts.SecurityContext; | 20 | import springfox.documentation.spi.service.contexts.SecurityContext; |
| 21 | import springfox.documentation.spring.web.plugins.Docket; | 21 | import springfox.documentation.spring.web.plugins.Docket; |
| 22 | -import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; | 22 | +import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| 23 | 23 | ||
| 24 | import java.util.Collections; | 24 | import java.util.Collections; |
| 25 | import java.util.List; | 25 | import java.util.List; |
| @@ -32,7 +32,7 @@ import static springfox.documentation.builders.RequestHandlerSelectors.basePacka | @@ -32,7 +32,7 @@ import static springfox.documentation.builders.RequestHandlerSelectors.basePacka | ||
| 32 | * @author 芋道源码 | 32 | * @author 芋道源码 |
| 33 | */ | 33 | */ |
| 34 | @Configuration | 34 | @Configuration |
| 35 | -@EnableSwagger2WebMvc | 35 | +@EnableSwagger2 |
| 36 | @EnableKnife4j | 36 | @EnableKnife4j |
| 37 | @ConditionalOnClass({Docket.class, ApiInfoBuilder.class}) | 37 | @ConditionalOnClass({Docket.class, ApiInfoBuilder.class}) |
| 38 | @ConditionalOnProperty(prefix = "yudao.swagger", value = "enable", matchIfMissing = true) | 38 | @ConditionalOnProperty(prefix = "yudao.swagger", value = "enable", matchIfMissing = true) |