0

I have a micronaut based backend. I develop locally with other db properties than our production setup. I want to have two configurations. One for local development and one for production.

I tried to add a application-prod.yml:

micronaut:
  application:
    name: backend
  server:
    cors:
      enabled: true
  db:
    addContactPoint: janusgraph
    port: 8182

and a application-dev.yml

micronaut:
  application:
    name: backend
  server:
    cors:
      enabled: true
  db:
    port: 8182

afterwards I added two properties to my class:

  @Value("${db.port}")
  protected int port;

  @Value("${db.addContactPoint}")
  protected String addContactPoint;

And then I tried to run it with:

MICRONAUT_ENVIRONMENTS=dev .\gradlew.bat run -t

But powershell said that there is no Cmdlet and so on...

How I can achieve to run my backend in dev mode locally or in prod mode in the production environment?

I tried to use the documentation. But things got not clear for me.

bg

Sebastian

Pace17881
  • 91
  • 7
  • Question with accepted answer that covers this case: https://stackoverflow.com/questions/56849937/how-do-you-run-micronaut-from-gradle-with-local-properties – Roar S. Oct 06 '21 at 17:07
  • Are you using `gradlew` to run your Micronaut apps in the production environment? – Jeff Scott Brown Oct 08 '21 at 15:25

0 Answers0