在加入Swagger之后启动就报错了,由此可知肯定是冲突了
错误信息如下:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
我目前的版本如下:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<relativePath/>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.SR1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
swagger 是自己封装的starter,spring-boot-starter-swagge
版本如下:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<springfox.version>2.2.2</springfox.version></properties><dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox.version}</version>
</dependency>
版本比较低,只要是升级到<springfox.version>2.5.0</springfox.version>
就可以了