I updated IntelliJ IDEA to version 2018.2.7, and Lombok's @Builder
annotation is not recognised anymore. The project already had Lombok annotations, which worked fine with previous (2017...) version of IntelliJ.
Only @Builder
is failing.
I am using Lombok version 1.14.4.
And Java 11.
The problem is similar to this one:
Lombok not working with Intellij
But the solution provided there is not applicable for my project as my project does not have a submodule and the only pom.xml
is referring to the correct project.
The project has Lombok plugin and Annotation processing enabled.
Project's POM where version is configured:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<lombok.version>1.14.4</lombok.version>
<hibernate-jpa-2.1-api.version>1.0.0.Final</hibernate-jpa-2.1-api.version>
<assertj-core.version>3.8.0</assertj-core.version>
</properties>
The error message at code level is: Cannot resolve symbol
@Builder.
If possible I would like to keep Lombok's and IntelliJ version.
Update your lombok version.
Because @Builder gained @Singular support and was promoted to the main lombok package since lombok v1.16.0.
Source
I have
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.20</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
and haven't that problem
I did no specify the version on my pom.xml and it got the latest version by default(1.18.8 I see this under External Libraries)
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
The Class.builder()
was not working for me but after installing the plugin(https://github.com/mplushnikov/lombok-intellij-plugin) it worked.
no extra configuration required. :)
In my case this is a problem with the version. Honestly. I downgrade to Version 1 and re-sync the Maven repositories:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<scope>provided</scope>
</dependency>
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