SpringBoot完整配置列表-yml

该文档详细配置了Web服务器的端口为8084,设置了Spring的Thymeleaf模板引擎参数,以及HTTP编码。同时,文章包含了修改MySQL服务器的连接信息,如地址、用户名和密码。此外,还配置了Redis服务器的地址和连接参数。另外,启用了Flyway进行数据库的自动迁移,并指定了MyBatis的相关配置。日志级别针对特定包设为调试模式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.设置web访问端口,默认端口号8084

server:
port: 8084
servlet:
session:
cookie:
name: local-portal
max-age: 3600
timeout: 3600

spring:
thymeleaf:
prefix: classpath:/templates/
cache: false
mode: LEGACYHTML5 # 用非严格的 HTML
encoding: UTF-8
servlet:
content-type: text/html
http:

设置编码

encoding:
  force: true
  charset: UTF-8
  enabled: true

devtools:
restart:
enabled: true #热部署生效
application:
name: stonedt-portal

2.修改设置MySQL服务器地址和用户名及密码

datasource:
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/stonedt_portal?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: root

3.修改设置Redis服务器地址

redis:
database: 0
host: localhost
port: 6379
password: launch
max-active: 10000
max-idle: 10
max-wait: 100000
timeout: 100000

flyway 自动建库建表设置

flyway:
enabled: true
locations: classpath:db/migration
baseline-on-migrate: true

mybatis:
type-aliases-package: com.stonedt.intelligence.entity
mapper-locations: classpath:mapper/*.xml

logging:
level:
com.stonedt.intelligence.dao : debug

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值