Micronaut development environment

I use Micronaut Default Environment to define a development environment.

I replace the Application class:

public class Application {
    public static void main(String[] args) {
        Micronaut.run(Application.class, args);
   }
}

with:

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

Then, I add to .gitignore a configuration file for the dev environment.

...
..
.
src/main/resources/application-dev.yml

What do I use application-dev.yml for? I have configuration for my local database, disable cookie access restriction while running in localhost, etc. Because of the git ignore inclusion, each developer in the team can have an application-dev.yml tailored to his machine.

Tags: #micronaut #environment
Sep 2021, 30.

 

My next events:
🗓 Jul 20 09:00 Workshop Security in the Micronaut Framework
🗓 Sep 20 09:00 JCON Online 2022 - Getting Started with the Micronaut Framework
🗓 Sep 23 09:00 JCON Online 2022 - Micronaut® Framework and Microstream Java-native persistence engine