SSM整合swagger

swagger的好处就不多说了.
说一下我在项目中,是如何配置,可以供每个系统开发人员使用的
1. Springmvc的配置文件添加

<bean class="springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration" id="swagger2Config"/>
<mvc:resources location="classpath:/META-INF/resources/" mapping="swagger-ui.html"/>
<mvc:resources location="classpath:/META-INF/resources/webjars/" mapping="/webjars/**"/>
  1. web工程中的pom文件中添加
<!--swagger-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.5.0</version>
</dependency>

3.启动,访问路径: http://服务地址:端口/工程名/swagger-ui.html
这个是直接把war包放到tomcat中html文件怎么打开.如果是在idea中
那么就是这样的了:


项目启动之后, 直接进入swagger访问地址了