I've faced problem when building my project that uses Lombok after swapping to different git branch. I get multiple exceptions generally of these two types:
@Setter(onMethod_ = @Autowired)
public class ClassA{
private ClassC c;
}
I get
java: cannot find symbol
symbol: method onMethod_()
location: @interface lombok.Setter
@Builder
public class ClassB{
}
I get
java: cannot find symbol
symbol: class ClassBBuilder
location: class com.example.application.ClassB
in methods like
private ClassB.ClassBBuilder getBuilder(Object input) {
//builder init
}
StackOverflowError
.The problem is fixed after running gradle:clean
-> gradle:build
. But comes up again after swapping branch.
Some more information:
I'm using Intellij Idea 2020.3.3 Ultimate Edition
and checkbox "Enable Annotation processing"
is checked.
Here are some parts of my 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
}
Does anybody know what could cause this problem?
This issue has been resolved in a newer version of Lombok. Please update the Lombok version to 1.18.18 and it will fix the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With