java /
正文
yml 项目配置参考学习备忘
2024-01-13 23:29
572 浏览
评论(0)
字体大小:
##########################################################
################## 所有profile共有的配置 #################
##########################################################
################### guns配置 ###################
guns:
swagger-open: true #是否开启swagger (true/false)
kaptcha-open: false #是否开启登录时验证码 (true/false)
#file-upload-path: d:/tmp
#文件上传目录(不配置的话为java.io.tmpdir目录)
muti-datasource-open: false #是否开启多数据源(true/false)
spring-session-open: true #是否开启spring session,如果是多机环境需要开启(true/false)
session-invalidate-time: 1800 #session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒
session-validation-interval: 900 #多久检测一次失效的session(只在单机环境下生效) 单位:秒
################### 项目启动端口 ###################
server:
port: 8080
################### beetl配置 ###################
beetl:
delimiter-statement-start: \@ #开始结束标签(yaml不允许@开头)
delimiter-statement-end: null
resource-tagroot: common/tags #自定义标签文件Root目录和后缀
resource-tagsuffix: tag
resource-auto-check: true #是否检测文件变化,开发用true合适,但线上要改为false
################### spring配置 ###################
spring:
redis:
host: 127.0.0.1
port: 6379
password:
profiles:
active: dev
mvc:
static-path-pattern: /static/**
view:
prefix: /WEB-INF/view
http:
converters:
preferred-json-mapper: fastjson
multipart:
max-request-size: 100MB #最大请求大小
max-file-size: 100MB #最大文件大小
devtools:
restart:
enabled: false #是否开启开发者工具(true/false)
additional-paths: src/main/java
exclude: static/**,WEB-INF/view/**
aop:
proxy-target-class: true #false为启用jdk默认动态代理,true为cglib动态代理
session:
store-type: none
jmx:
enabled: false
################### mybatis-plus配置 ###################
mybatis-plus:
mapper-locations: classpath*:com/baiyang/oms/**/mapping/*.xml
typeAliasesPackage: com.baiyang.oms.modular.system.model
global-config:
id-type: 0 #0:数据库ID自增 1:用户输入id 2:全局唯一id(IdWorker) 3:全局唯一ID(uuid)
db-column-underline: false
refresh-mapper: true
logic-delete-value: 0
logic-not-delete-value: 1
sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector
configuration:
map-underscore-to-camel-case: false
cache-enabled: true #配置的缓存的全局开关
lazyLoadingEnabled: true #延时加载的开关
multipleResultSetsEnabled: true #开启的话,延时加载一个属性时会加载该对象全部属性,否则按需加载属性
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
---
##########################################################
################### 开发环境的profile ###################
##########################################################
spring:
profiles: dev
datasource:
url: jdbc:mysql://127.0.0.1:3306/oms?useUnicode=true&characterEncoding=UTF-8&useUnicode=true&useSSL=false&allowMultiQueries=true
username: hiveuser
password: hivepassword
db-name: oms
filters: log4j,wall,mergeStat
#flowable数据源和多数据源配置
guns:
flowable:
datasource:
url: jdbc:mysql://127.0.0.1:3306/guns_flowable?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
username: hiveuser
password: hivepassword
muti-datasource:
default-dataSource-name: oms #默认的数据源名称
url: jdbc:mysql://172.17.30.42:3306/oms?useUnicode=true&characterEncoding=UTF-8&useUnicode=true&useSSL=false&allowMultiQueries=true
username: hiveuser
password: hivepassword
logging:
level.root: info
level.com.baiyang: debug
path: logs/
file: oms.log
---
本文发布于程序达人 ,转载请注明出处,谢谢合作
有 0 人认为有用
0 评论
共同学习,写下你的评论
相关热点文章推荐
SpringBoot 2.0 报错: Failed to configure a DataSource: 'url' attribute is not specified and no embe...
程序达人 - chengxudaren.com
一个帮助开发者成长的社区
相关文章