Lombok @Builder "cannot find symbol" error with Maven & IntelliJ
Hey everyone, I'm facing a frustrating issue with Project Lombok and could use some help. I'm working on a Spring Boot project using IntelliJ IDEA and Maven, and I'm getting a java: cannot find symbol error for the builder() method.
The error occurs in my test class ShutterResponseDTOTest.java when I try to instantiate a DTO using the builder pattern. Here are the relevant code snippets and the full error message.
What I've already checked and done:
I've correctly added the Lombok dependency to my pom.xml.
I’ve confirmed that “Enable annotation processing” is checked in my IntelliJ IDEA settings (Settings > Build, Execution, Deployment > Compiler > Annotation Processors).
I also tried using the <optional>true tag for the dependency, but that didn't work either, so I reverted to provided.
I have the Lombok plugin installed in IntelliJ.





13 Replies
⌛
This post has been reserved for your question.
Hey @kyrylomalyi! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
Have you tried explictly rebuilding your project?
Also
<optional>true</optional>
is something which is relevant when resolving transitive dependencies. I think what you are looking for is <scope>compile</scope>
but this is already the default.yeah rebuilding using idea button and than also ./mvnw test
and again getting same error


Do you have the annotation processor set up in the configuration of your
<build>
plugins in the pom.xml
?
yes i have it was auto generated by spring intlzr

also tried to check would it works in just main class not in test enviroment and it also does not work here

Does it build from command line?
test or main with builder?
The one which is not working.
OKAY look ive tried ./mvnw clean install and now everything works great
thank you! u are smarter than ai
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Post Closed
This post has been closed by <@1406725416932216894>.