0
votes

I'm having an issue with Lombok or Eclipse, not sure which. I have a Spring Boot maven project for which I am using Lombok. I've added this in my pom.xml file and I've used the lombok install for eclipse.

Whats happening is that I can do a mvn clean and a mvn install and a maven update on the project and everything builds as expected. As soon as I go to run the project errors start to appear and I get error such as:

java.lang.Error: Unresolved compilation problems: 
    The method getxxx() is undefined for the type xxxxxx

Is there anything that can happen when running the project that can some how strip out lombok?!

I'm running Eclipse Oxygen (4.7.3) with lombok v1.16.18 "Dancing Elephant" any help would be much appreciated.

2
That's because your getter and setter methods aren't generated in your .class files when you run the project. Please check this answer for more details. - cнŝdk
That sounds like the issue to me, however when I follow the instructions in the answer to provided I still get the same issue :( - SpaceCowboy
What version of Java are you targeting? I've had similar issues with Java 9 and Java 10. Java 8 is the only one that seems to work perfectly. - Michael
Did you also do mvn eclipse:eclipse after adding lombok to the pom? Also, are you running the project from within Eclipse, or from maven/appassembler/whatever? - tobias_k
I'm using Java 8, strangely it has been working perfectly. Only recently this has started to occur. I've rolled back to a version which worked but im still seeing the issue - SpaceCowboy

2 Answers

0
votes

I don't know how exactly in eclipse, but in the ​​Intellij IDEA I need to install the lombok plugin in the settings, I suspect that in eclipse also it needs to be done.

0
votes

Here is tested link for setting up lombok for the eclipse as well as intellij.

https://www.baeldung.com/lombok-ide