Best way to inject beans into instance fields #6375
-
Being new to Micronaut, I'm trying to find the best/most concise way to inject beans into instance fields, which works both in a regular JVM and GraalVM native image. Below are some of the approaches that I've tried so far (note that I'm also using some Lombok annotations). All of these approaches work fine when running in a normal JVM, but most of these fail when running as a GraalVM native image. Any suggestions or alternative approaches that I didn't think of yet?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
you need the |
Beta Was this translation helpful? Give feedback.
you need the
micronaut-graal
processor to make the other use cases work as reflection data has to be registered and your build is missing that processor