Table of contents
  1. Environment Settings
  2. Run in Development
    1. replace application
    2. add to build.gradle
    3. cli
    4. ide




Environment Settings

The Micronaut framework uses the following hierarchy for environment processing (lowest to highest priority):

  • Deduced environments
  • Environments from the micronaut.environments system property
  • Environments from the MICRONAUT_ENVIRONMENTS environment variable
  • Environments specified explicitly through the application context builder
Available Env Fields

Run in Development

replace application

public class Application {
    public static void main(String[] args) {
        Micronaut.build(args)
                 .mainClass(Application.class)
                 .defaultEnvironments(Environment.DEVELOPMENT)
                 .start();
    }
}

add to build.gradle

run {
    systemProperty('micronaut.environments', 'dev')
}

cli

./gradlew -Dmicronaut.environments=dev run

ide

image