Table of contents
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
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