How to specify a profile in a Micronaut application?

11,544

You can set active environment(s) either by system property micronaut.environments (java -Dmicronaut.environments=foo,bar -jar myapp.jar) or by environment variable MICRONAUT_ENVIRONMENTS.

See Documentation: https://docs.micronaut.io/snapshot/guide/index.html#environments

Share:
11,544
tomas lingotti
Author by

tomas lingotti

Updated on June 05, 2022

Comments

  • tomas lingotti
    tomas lingotti almost 2 years

    I want to specify different types of configs depending on the environment that I will deploy the app. Like in Spring-boot in the yml file we can set the profile, I want to know if there is a way to do it in Micronaut.

  • Jeff Scott Brown
    Jeff Scott Brown over 5 years
    We also support config files like application-gcp.yml, which would only be loaded if running on GCP (for example).