Jim Wharton
Jim Wharton

Reputation: 1415

Micronaut will not honor application.dev.yml when running in dev environment

When I run gradle run during development, shouldn't Micronaut be using an application-dev.yml if one exists? I've also tried compiling a jar and running it with:

java -jar build/libs/mockidm-0.5-all.jar -Dmicronaut.environments=dev

But Micronaut still only reads values from application.yml

Am I misunderstanding that gradle run runs the app in dev mode? If not, how do I do that?

Upvotes: 1

Views: 2260

Answers (2)

Swanand Keskar
Swanand Keskar

Reputation: 1073

You need to set the following environment variable

MICRONAUT_ENVIRONMENTS=dev

for running it locally

Upvotes: 1

Jim Wharton
Jim Wharton

Reputation: 1415

I had to add

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

I couldn't seem to find this documented anywhere.

Upvotes: 1

Related Questions