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

Had the same problem using maven-compiler-plugin v.2.3.2 After updating the version up to 3.5 problem disappeared

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.5</version>
    <configuration>
        ...
    </configuration>
</plugin>

Hope this helps


I was actually able to solve this by following an answer posted here :

MapStruct and Lombok not working together

Basically I had to add lombok to the maven-compiler-plugin <annotationProcessorPaths>


If you're using Lombok related static methods (mainly @Builder) with static imports, you might experience similar issues (even in other parts of your code!).

There is an open issue about it: https://github.com/rzwitserloot/lombok/issues/979

The current workaround is to simply not use static imports, e.g. change

import static my.org.Foo.FooBuilder
 ...
FooBuilder builder = Foo.builder();

to:

Foo.FooBuilder builder = Foo.builder(); // note >>Foo.<<FooBuilder; without static import

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 :(

Tags:

Java

Maven

Lombok