eureka:
client:
enabled: true #启用Eureka客户端
healthcheck:
enabled: true #开启心跳检查
fetch-registry: true #表示是否从Eureka Server获取注册的服务信息
register-with-eureka: true #表示是否从Eureka Server获取注册的服务信息
instance-info-replication-interval-seconds: 10 #服务实例信息向Eureka Server同步的周期(默认30s)
registry-fetch-interval-secondes: 10 #缓存清单的更新时间
instance:
appname: ${spring.application.name} #设定注册在Eureka中的服务名
instanceId: ${spring.application.name}:${spring.application.instance-id:${server.port}} #注册名
lease-renewal-interval-in-seconds: 5 #参数用于定义服务续约任务的调用间隔时间,默认30秒
lease-expiration-duration-in-seconds: 10 #用于定义服务失效的时间,默认90秒
metadata-map: #自定义元数据
profile: ${spring.profiles.active}
version: ${info.project.version}
spring:
application:
name: ${spring.application.name}
jackson:
seriallzation:
WRITE_DATES_AS_TIMESTAMPS: false #Spring的jackson日期格式,取消timestamps形式
jpa:
open-in-view: false #在事务外也可以访问懒加载的数据
hibernate:
ddl-auto: none
# none: 不指定数据库初始化模式
# create: 当Spring Boot应用运行时,会删除并重新创建数据库。所以每次启动时,所有的数据都会被清空
# create-drop: 当sessionFactory关闭,表会自动删除
# validate: 在Spring Boot应用运行时,会检查数据库中的表与java实体类是否匹配。如果不匹配,则运行失败
# update: 当在java实体类中新增了一个字段,在应用重新运行时,会将字段添加到数据库表中的新列,但不会移除先前存在的列或约束
naming:
#(1)、implicit-strategy负责模型对象层次的处理,将对象模型处理为逻辑名称。physical-strategy负责映射成真实的数据名称的处理,将上述的逻辑名称处理为物理名称。
#(2)、当没有使用@Table和@Column注解时,implicit-strategy配置项才会被使用,当对象模型中已经指定时,implicit-strategy并不会起作用。physical-strategy一定会被应用,与对象模型中是否显式地指定列名或者已经被隐式决定无关。
physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
#Hibernate5物理命名策略完全限定名
#hibernate4中的ImprovedNamingStrategy 表名,字段为小写,当有大写字母的时候会转换为分隔符号“_”。
implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
#Hibernate5隐式命名策略完全限定名称。
messages: #国际化
basename: il8n/messages #指定message的basename,多个以逗号分隔,如果不加包名的话,默认从classpath路径开始,默认: messages
mvc:
favicon:
enabled: false #关闭默认图标
thymeleaf:
mode: XHTML #Thymeleaf模板引擎
security:
basic:
enabled: false
oauth2:
resource:
filter-order: 3
jhipster:
swagger:
default-include-pattern: /api/.*
title: ${spring.application.name} API
description: ${spring.application.name} API documention
version: 0.0.1
terms-of-service-url:
contact-name:
contact-url:
contact-email:
license:
license-url:
ribbon:
display-on-active-profiles: dev
mybatis:
mapperLocations: classPath*:mapper/*.xml
typeAliasesPackage: cn.com.xxx.user.domain
config: classpath:mybatis-config.xml
mapper:
mappers:
- cn.com.xxx.commons.mapper.CommonMapper
pagehelper:
helperDialect: oracle
reasonable: true
SpringCloud中的application.yml剖析(以user模块为例)
最新推荐文章于 2024-06-12 14:04:42 发布