<Injecting Spring Boot properties into Kotlin Sing...
# stackoverflow
u
Injecting Spring Boot properties into Kotlin Singleton / object I have a Spring Boot 2 project, and I'm using Kotlin. What I want to achieve, is to have a Kotlin singleton (i.e. an object) and inject Spring properties. Normally, I'd do this using constructor injection, which is the preferred way. However, for objects, constructors are not allowed. Another option is to use lateinit var combined with @Value("\${my.property.name}"), though then I'd have to initialize the field, which I don't prefer. What is the required approach for this?