Re-run Spring Boot Configuration Annotation Processor to update generated metadata

Eric Francis picture Eric Francis · Nov 2, 2015 · Viewed 95.4k times · Source

I've added:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-configuration-processor</artifactId>
    <optional>true</optional>
</dependency>

to my pom.xml per intellij's request/warning.

Now I'm seeing "Re-run Spring Boot Configuration Annotation Processor to update generated metadata".

How do I do what intellij is asking me to do?

This link, B.2 Generating your own meta-data using the annotation processor, does not have instructions.

Answer

Patrick Herrera picture Patrick Herrera · Nov 8, 2015

Following these instructions worked for me: http://www.mdoninger.de/2015/05/16/completion-for-custom-properties-in-spring-boot.html

That message about having to Re-run the Annotation Processor is a bit confusing as it appears it stays there all the time even if nothing has changed.

The key seems to be rebuilding the project after adding the required dependency, or after making any property changes. After doing that and going back to the YAML file, all my properties were now linked to the configuration classes.

You may need to click the 'Reimport All Maven Projects' button in the Maven pane as well to get the .yaml file view to recognise the links back to the corresponding Java class.