Builds with Gradle 5.2.1 and Lombok 1.18.6 dependency are failing with JDK 10. It seems Lombok annotation are not being processed appropriately. I keep getting "cannot find symbol" error across various Java files in my source. Any thoughts on why this might be happening? I found that a defect has already been created: https://github.com/rzwitserloot/lombok/issues/1572
I am using:
Java JDK 10
Gradle 5.2.1
Lombok 1.18.6
Thanks.
I found the following work around for this issue using a plugin for processing Lombok annotation in compile time.
I had to perform the following steps in build.gradle:
1) Add id "net.ltgt.apt" version "0.15"
to plugins section.
2) Add maven { url 'https://projectlombok.org/edge-releases' }
to repositories section.
3) Add the following to dependencies section:
compileOnly 'org.projectlombok:lombok:edge-SNAPSHOT'
apt 'org.projectlombok:lombok:edge-SNAPSHOT'
compileOnly 'org.projectlombok:lombok:1.18:6'
annotationProcessor 'org.projectlombok:lombok:1.18:6'
4) Add a task:
tasks.withType(JavaCompile) {
options.annotationProcessorPath = configurations.apt
}
This lets your build complete successfully.
Update 03/29/2019: This workaround also works with Gradle 5.3, Java JDK 10
Thanks.
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