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: 密码

 

posted @ 2022-01-06 10:37  Shadow997  阅读(393)  评论(0)    收藏  举报