Skip to content

Instantly share code, notes, and snippets.

@maketheworldwise
Last active June 11, 2023 14:43
Show Gist options
  • Save maketheworldwise/94dc41c70e0f5749b29321ef18569a87 to your computer and use it in GitHub Desktop.
Save maketheworldwise/94dc41c70e0f5749b29321ef18569a87 to your computer and use it in GitHub Desktop.
[Spring] application.yml 설정 분리

개발환경별 설정 파일 분리 방법

spring:
  profiles:
    default: local

  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/test?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
    username: root
    password: password

  sql:
    init:
      mode: never

  jpa:
    open-in-view: true
    hibernate:
      ddl-auto: none
      naming:
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
      use-new-id-generator-mappings: false
    show-sql: false
    properties:
      hibernate:
        format_sql: true
      dialect: org.hibernate.dialect.MySQL5InnoDBDialect

logging:
  level:
    org:
      hibernate:
        SQL: debug
        type: trace
spring:
  config:
    activate:
      on-profile: dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment