SpringForAll / spring-boot-starter-swagger

自制spring boot starter for swagger 2.x,来试试吧,很好用哦~
Apache License 2.0
2.13k stars 523 forks source link

参考 https://github.com/springfox/springfox/issues/2265, #128

Closed dunwu closed 5 years ago

dunwu commented 5 years ago

参考 https://github.com/springfox/springfox/issues/2265

修改 pom.xml

<dependency>
    <groupId>com.spring4all</groupId>
    <artifactId>swagger-spring-boot-starter</artifactId>
    <version>1.8.0.RELEASE</version>
    <exclusions>
        <exclusion>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
        </exclusion>
        <exclusion>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-models</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>io.swagger</groupId>
    <artifactId>swagger-annotations</artifactId>
    <version>1.5.21</version>
</dependency>
<dependency>
    <groupId>io.swagger</groupId>
    <artifactId>swagger-models</artifactId>
    <version>1.5.21</version>
</dependency>

或者修改 build.gradle

compile ('com.spring4all:swagger-spring-boot-starter:1.8.0.RELEASE') {
    exclude module: 'swagger-annotations'
    exclude module: 'swagger-models'
}
compile "io.swagger:swagger-annotations:1.5.21"
compile "io.swagger:swagger-models:1.5.21"

应该可以解决。

Originally posted by @huahouye in https://github.com/SpringForAll/spring-boot-starter-swagger/issues/116#issuecomment-428481666