Thanks for pointing me in the right direction. So the solution is to add
dependencies { ... kapt "org.springframework.boot:spring-boot-configuration-processor" optional "org.springframework.boot:spring-boot-configuration-processor" ... }
in build.gradle , run gradle compileJava on the command line and enable annotation processing in the IntelliJ Idea settings. Build, execute, deploy β Compiler β Annotation Processor β Enable annotation processing . The rest of the configuration remains the same
Also note that without this line
optional "org.springframework.boot:spring-boot-configuration-processor"
IntelliJ Idea will complain whith
Unable to resolve configuration property
in application.properties or application.yml
source share