Skip to content

Instantly share code, notes, and snippets.

@maketheworldwise
Last active June 11, 2023 14:41
Show Gist options
  • Save maketheworldwise/ca3285b7f503de8ace1e19f289ca0390 to your computer and use it in GitHub Desktop.
Save maketheworldwise/ca3285b7f503de8ace1e19f289ca0390 to your computer and use it in GitHub Desktop.
[Spring] 환경별 다중 application.yml 설정

개발환경별 application.yml 설정 방법

spring:
  profiles:
    active: local

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

  sql:
    init:
      mode: always

---

spring:
  profiles:
    active: dev

---

spring:
  profiles:
    active: prod 
@maketheworldwise
Copy link
Author

profile별 구동 명령어 : java -jar -Dspring.profiles.active=local Application.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment