Java SpringBoot配置yml文件
Java SpringBoot配置 yml文件
application.yml
spring: profiles: active: dev mybatis: mapper-locations: classpath:/com/cyjt/app/decoctionprogram/**/**/mapper/xml/*.xml configuration: map-underscore-to-camel-case: true log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
开发环境
application-dev.yml
server: port: 端口 spring: application: name: 项目名称 datasource: url: jdbc:mysql://localhost:3306/数据库名称?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2b8 username: 账号 password: 密码
生产环境
application-prod.yml
server: port: 端口 spring: application: name: 项目名称 datasource: url: jdbc:mysql://localhost:3306/数据库名称?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2b8 username: 账号 password: 密码

浙公网安备 33010602011771号