Lombok的应用程序构建失败原因

在切换到不同的 git 分支后,我在构建使用 Lombok 的项目时遇到了问题。我通常会收到这两种类型的多个异常:

  1. 对于像这样的课程
@Setter(onMethod_ = @Autowired)
public class ClassA{

   private ClassC c;

}

我得到

java: cannot find symbol
  symbol:   method onMethod_()
  location: @interface lombok.Setter
  1. 对于像这样的课程
@Builder
public class ClassB{

}

我得到

java: cannot find symbol
  symbol:   class ClassBBuilder
  location: class com.example.application.ClassB

在像这样的方法中

private ClassB.ClassBBuilder getBuilder(Object input) {
    //builder init
}
  1. 毕竟我得到了StackOverflowError

运行gradle:clean->后问题已解决gradle:build。但是在交换分支后又出现了。更多信息:我正在使用Intellij Idea 2020.3.3 Ultimate Edition并选中复选框"Enable Annotation processing"。这是我的一些部分build.gradle

import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
    id 'net.ltgt.apt' version '0.19'
    id 'net.ltgt.apt-idea' version '0.19'
    id 'org.springframework.boot' version '2.3.2.RELEASE' apply false
}

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.ltgt.apt'
apply plugin: 'net.ltgt.apt-idea'
apply plugin: 'io.spring.dependency-management'

repositories {
    maven { url = 'https://repo.maven.apache.org/maven2' }
}

dependencyManagement {
    imports {
        mavenBom SpringBootPlugin.BOM_COORDINATES
    }
}

dependencies {
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'
    annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
//other dependencies
}

有谁知道什么可能导致这个问题?

以上是Lombok的应用程序构建失败原因的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>