当时我在Github上下载了一个SpringBoot的项目,导入IDEA后,弹出 Spring Boot Annotion processor not found in classpath错误。网上有人说不用关它,直接运行也是可以的,但是毕竟看着难受。下面就是解决方案:
用Maven构建的项目,在pom.xml中导入依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
用Gradle4.5以前的版本,在build.gradle中导入依赖
dependencies {
compileOnly "org.springframework.boot:spring-boot-configuration-processor"
}
用Gradle4.6以后的版本,在build.gradle中导入依赖
dependencies {
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
}