您的位置:首页 > 编程语言 > Java开发

springboot的application.yml配置

2020-07-14 05:56 411 查看

springboot+mybatis+thymeleaf

server:
port: 443 #项目端口号
ssl: #ssl证书配置
key-store: classpath:client.pfx
key-store-type: PKCS12
key-store-password: e9wb6Go8
web: #服务器静态资源路径
upload-path: /www/server/webapps/upload
front-path: /www/server/webapps/upload
spring:
servlet:
multipart:
enabled: true #是否启用http上传处理
max-request-size: 100MB #最大请求文件的大小
max-file-size: 20MB #设置单个文件最大长度
file-size-threshold: 20MB #当文件达到多少时进行磁盘写入
datasource:
#mysql5 中com.mysql.jdbc.Driver
#mysql6 中com.mysql.cj.jdbc.Driver  注意连接时需要指定时区serverTimezone
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/fangdichan?serverTimezone=UTC&characterEncoding=utf-8
username: #数据库账号
password: #数据库密码
type: com.alibaba.druid.pool.DruidDataSource
resources: #项目中静态资位置
static-locations : classpath:/static/,file:${web.upload-path},file:${web.front-path}
devtools:
restart:
enabled: true  #设置开启热部署
additional-paths: src/main/java #重启目录
exclude: classpath:/templates/
freemarker:
cache: false    #页面不加载缓存,修改即时生效
template:
cache: false
thymeleaf:
prefix: classpath:/templates/  #prefix:指定模板所在的目录
check-template-location: true  #check-tempate-location: 检查模板路径是否存在
cache: false  #cache: 是否缓存,开发模式下设置为false,避免改了模板还要重启服务器,线上设置为true,可以提高性能。
suffix:  .html
#encoding: UTF-8
#content-type: text/html
mode: HTML5
mvc:
dateFormat: yyyy-MM-dd HH:mm:ss #配置时间格式前台传时间要转成该格式,否者会报错
favicon:
enabled: false #关闭springboot自带的favicon图标
jackson:
date-format: yyyy-MM-dd HH:mm:ss #配置时间格式前台传时间要转成该格式,否者会报错
time-zone: GMT+8
mybatis:
#扫描classpath中mapper目录下的映射配置文件,针对与映射配置文件放到了resource目录下
mapper-locations: classpath:mapper/*.xml
#标签作用mapper.xml中返回pojo时不需要写包名,直接写对象名即可
type-aliases-package: com.bz.bean
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: