Reputation: 633
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?
Upvotes: 5
Views: 5212
Reputation: 182
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.
Upvotes: 4
Reputation: 22369
I think you need to upgrade your lombok dependencies to the latest version.
Upvotes: 0