Saturday, July 9, 2022

Spring Boot application.properties and application.yml

application.properties
spring.profiles.active=dev
#---
spring.config.activate.on-profile:dev
message: "Hello from local!"
#---
spring.config.activate.on-profile:prod
message: "Hello, from App Engine!"

#####################################################
application.yml
spring:
  profiles:
    active:
    - dev
---
spring:
  config:
    activate:
      on-profile: dev
environment: development
message: "Hello, from local!"
---
spring:
  config:
    activate:
      on-profile: prod
environment: production
message: "Hello, from App Engine!"

 

No comments: