Spring boot 1.x 升级2.x, swagger,redis 升级

发布时间 2023-07-04 17:23:49作者: tomcat and jerry

# Spring boot 1.x 升级2.x 

boot 1.5.22 -> 2.7.0

swagger 2.9.2 -> 3.0.0

spring-data-redis 1.8.4.RELEASE -> 2.7.0

## swagger:


```
<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-boot-starter</artifactId>
  <version>3.0.0</version>
</dependency>
<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-swagger2</artifactId>
  <version>3.0.0</version>
  <exclusions>
    <exclusion>
      <groupId>io.swagger</groupId>
      <artifactId>swagger-models</artifactId>
      <!-- 排除默认1.5.20 因为有example bug-->
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>io.swagger</groupId>
  <artifactId>swagger-models</artifactId>
  <version>1.5.21</version>
  <scope>compile</scope>
</dependency>
<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-swagger-ui</artifactId>
  <version>3.0.0</version>
</dependency>

```

## redis

```
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-data-redis</artifactId>
  <version>2.7.0</version>
</dependency>
```

## application.yml

```
spring:
  mvc:
    pathmatch:
       matching-strategy: ant_path_matcher #2.7.0默认的路径匹配改了
```

## ConfigurationProperties(prefix= "这里不支持驼峰"

比如:
```
client-pay:
  wechatPay:
    id: 1234
```

ConfigurationProperties(prefix="client-pay.wechatPay") //这里报错

需要改成:

ConfigurationProperties(prefix="client-pay.wechat-pay")