8. springboot yaml 파일로 변경
in Gitlog on springboot-restful
스프링 Cloud Config를 사용하기 전에 application.propertis 파일을 application.yml 로 변경하는 포스팅
yaml 파일로 변경
기존에 사용하던 application.properites 를 삭제하고 application.yml 생성한다.
 DatabaseConfiguration 에서도 application.properites 를 미사용하기에 삭제한다.
YAML 파일이란
Yet Another Markup Language의 약자로, 사람이 읽을 수 있는 데이터 직렬화 언어을 뜻한다.
DatabaseConfiguration.java
//@PropertySource("classpath:application.properties")
application.yml
spring:
  datasource:
    hikari:
      connection-test-query: SELECT 1
      allow-pool-suspesion: true
  jpa:
    database: mysql
    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
    generate-ddl: true
    hibernate:
      use-new-id-generator-mappings: false
mybatis:
  configuration:
    map-underscore-to-camel-case: true
---
spring:
  profiles: dev
  datasource:
    hikari:
      driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
      jdbc-url: jdbc:log4jdbc:mysql://localhost:3306/demo_neo?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
      username: root
      password: 1111
  thymeleaf:
    cache: false
  resources:
    cache:
      period: 0
---
spring:
  profiles: prod
  datasource:
    hikari:
      driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
      jdbc-url: jdbc:log4jdbc:mysql://localhost:3306/demo_neo?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
      username: root
      password: 1111
  thymeleaf:
    cache: false
  resources:
    cache:
      period: 0
