simonC simonC - 1 month ago 28
Java Question

Maven build cannot find symbol when accessing project lombok annotated methods,

I'm using project lombok for the first time and I have problems compiling the project via maven when I run the build I receive errors where methods annotated with project lombok annotations are called.

This is the annotated parameter:

private @Getter @Setter String paymentNonce = null;


and in this line for example the maven breaks the build:

if (!StringUtilities.isNullOrEmpty(getPaymentNonce())) {


this is my maven dependency

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.4</version>
</dependency>


the maven error:

[INFO] Compiling 158 source files to C:\java\repos\luna\cloudflow\cloudflow-ejb\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \java\repos\luna\cloudflow\cloudflow-ejb\src\main\java\si\arctur\controller\PaymentProcessor.java:[94,38] error: cannot find symbol
[ERROR] \java\repos\luna\cloudflow\cloudflow-ejb\src\main\java\si\arctur\controller\PaymentProcessor.java:[97,106] error: cannot find symbol
[ERROR] \java\repos\luna\cloudflow\cloudflow-ejb\src\main\java\si\arctur\controller\PaymentProcessor.java:[142,2] error: cannot find symbol
[ERROR] \java\repos\luna\cloudflow\cloudflow-ejb\src\main\java\si\arctur\controller\ShoppingCart.java:[27,6] error: cannot find symbol
[ERROR] \java\repos\luna\cloudflow\cloudflow-ejb\src\main\java\si\arctur\controller\ShoppingCart.java:[32,75] error: cannot find symbol
.....


I'm using java 8

Answer

I have downgraded the lombok to 1.14.8 this version works with maven build, I havent found why the 1.16 verson is not working :(