snow8261
snow8261

Reputation: 1009

Project in Spring Tool Suite report "Unable to load annotation processor factory"

My project in Spring Tool Suite report Unable to "load annotation processor factory 'org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor' for project XXX", My project runs fine, but I do not want to see this error.I did a lot of searching, but I could not find any result. Thanks a lot.

enter image description here

Upvotes: 26

Views: 21889

Answers (4)

NaN
NaN

Reputation: 9104

After much trouble trying to fing a working answer for this error, I finally found the way myself:

In Project Properties > Java Compiler > Annotation Processing > Factory Path

  1. Enable project specific settings;
  2. [Apply and Close];
  3. re-Build the Project;
  4. Go again in Factory Path;
  5. Disable project specific settings;
  6. [Apply and Close].

The error messages will go away.

enter image description here

Upvotes: 1

Bampfer
Bampfer

Reputation: 2220

I am using Eclipse, not Spring Tools Suite, but maybe this will still be helpful..

Eclipse reported the following as an APT Problem:

Unable to load annotation processor factory '/path/to/gradle/cache/org.springframework.boot/spring-boot-configuration-processor/2.4.4/12575686ba3820571ea79bfd08d6d27534b97a0e/spring-boot-configuration-processor-2.4.4.jar' for project ...

The version of the annotation processor factory in the error message was from an older version of Spring Boot. The project had been migrated.

I opened project properties Java Compiler -> Annotation Processing -> Factory Path and removed the old spring-boot-configuration-processor jar from the list, and the error went away. The correct jar was there already.

Upvotes: 0

bzani
bzani

Reputation: 527

Delete the .factory file from the project root directory.

Upvotes: 43

Abacus
Abacus

Reputation: 19471

You need to add the spring boot configuration processor to your project; when using maven add this dependency:

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

You find more information in the spring boot documentation.

Upvotes: 3

Related Questions