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.
This question is related to
java
spring
maven
intellij-idea
I had the same issue. The problem is that the Spring Boot annotation processor generates the spring-configuration-metadata.json
file inside your /target/classes/META-INF
folder.
If you happen to have ignored this folder in IntelliJ like me (because what the heck, who cares about classes files?), the file won't be indexed by your IDE. Therefore, no completion, and the annoying message.
Just remove target
from the ignore files/folders list, located in Settings > Editor > File Types > Ignore files and folders
.
None of the answers worked for me. If you just want to disable the message, go to Intellij Preferences -> Editor -> General -> Appearance, uncheck "Show Spring Boot metadata panel".
However, you can also live with that message, if it does not bother you too much, so to make sure you don't miss any other Spring Boot metadata messages you may be interested in.
None of these options worked for me. I've found that the auto detection of annotation processors to be pretty flaky. I ended up creating a plugin section in the pom.xml file that explicitly sets the annotation processors that are used for the project. The advantage of this is that you don't need to rely on any IDE settings.
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<compilerVersion>1.8</compilerVersion>
<source>1.8</source>
<target>1.8</target>
<annotationProcessors>
<annotationProcessor>org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor</annotationProcessor>
<annotationProcessor>lombok.launch.AnnotationProcessorHider$AnnotationProcessor</annotationProcessor>
<annotationProcessor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</annotationProcessor>
</annotationProcessors>
</configuration>
</plugin>
Having included a dependency on spring-boot-configuration-processor
in build.gradle
:
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:2.4.1"
the only thing that worked for me, besides invalidating caches of IntelliJ and restarting, is
Reload All Gradle Projects
Clean
Build
For me, other answers didn't work. I had to go to open Files
and do Invalidate caches and restart
on Intellij. After that, everything worked fine again.
You can enable annotation processors in IntelliJ via the following:
Source: Stackoverflow.com