Home:ALL Converter>Micronaut native image ignores properties

Micronaut native image ignores properties

Ask Time:2022-02-06T22:14:35         Author:Alex Bondar

Json Formatter

I am trying to build graalvm native image of my micronaut application. I see the werid issue that some of the properties from application.yaml are ignored, though when I run the app via

./gradlew run

all works fine.

Here is my yaml

micronaut:
  application:
    name: phonebook
  caches:
    phonebook:
      charset: UTF-8
  router:
    static-resources:
      swagger:
        paths: classpath:META-INF/swagger
        mapping: /swagger/**
      swagger-ui:
        paths: classpath:META-INF/swagger/views/swagger-ui
        mapping: /doc/**

endpoints:
  caches:
    enabled: true
    # sensitive: false
  env:
    enabled: true
   # sensitive: false

fauna:
  secret: '${FAUNA_KEY}'
  endpoint: https://db.eu.fauna.com:443

Here is how I read the properties in the class

@Value("${fauna.secret}")
  private String faunaKey;

@Value("${fauna.endpoint}")
  private String faunaEndpoint;

What could cause an issue?

Author:Alex Bondar,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/71008037/micronaut-native-image-ignores-properties
yy