1. 程式人生 > >springboot 常用配置文件

springboot 常用配置文件

com 別名 and path ring 最大 ase framework depend

1.連接數據庫

<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.1.1</version>
</dependency>

#MyBatis 映射文件配置 指定mapper包路徑
mybatis.mapper-locations=classpath:com/springboot/mapper/*.xml
#MyBatis掃描別名包,和 註解@Alias

mybatis.type-aliases-package=com.springboot.pojo
#配置 typeHandler 的掃描包
mybatis.type- handlers-package=com.springboot.typehandler
#日誌配置
logging.level.root=DEBUG
logging.level.org.springframework=DEBUG
logging.level.org.org.mybatis=DEBUG

2.連接Redis配置

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-redis -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.1.3.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.1.0-m1</version>
</dependency>

### redis 最小空閑連接

spring.redis.jedis.pool.min-idle=5

### 連接池最大連接數
spring.redis.jedis.pool.max - active=10

### 連接池最大空閑連接數量
spring.redis.redis.pool.max-idle=10

### 連接池最大阻塞等待時間
spring.redis.jedis.pool.max-wait=2000

### redis 端口號
spring.redis.port=6379

### redis ip地址
spring.redis.host=127.0.0.1

### redis密碼
spring.redis.password=123456

### redis 連接超時時間
spring.redis.timeout=1000

springboot 常用配置文件