Lombok: Annotation processor 'lombok.core.AnnotationProcessor' not found

Created on 27 Aug 2015  Â·  7Comments  Â·  Source: projectlombok/lombok

Hi,

I'm using lombok in my entities and want to produce MetaModelEntities. So I used lombok Annotation Processor. When i compile the project it gives below error:

"Annotation processor 'lombok.core.AnnotationProcessor' not found"

Here are my tools versions :

Maven 3.2.5
Java 1.8
Lombok 1.16.6

Here is how i use lombok:

 <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>${project.java.version}</source>
                    <target>${project.java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <!--<compilerArgument>-proc:none</compilerArgument>-->
                    <annotationProcessors>
                        <annotationProcessor>lombok.core.AnnotationProcessor</annotationProcessor>
                    </annotationProcessors>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>2.2.4</version>
                <executions>
                    <execution>
                        <id>process</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <!-- source output directory -->
                            <outputDirectory>${generated-java-source}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.9.1</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${generated-java-source}</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
</plugins>

If i use lombok 1.14.8, I don't get see any problem. When i look at the 1.16.6 jar file. lombok.core.AnnotationProcessor is over there but all class extensions are .lombok. I think this causes the problem.

How can i solve it?

question

Most helpful comment

When i change AnnotationProcessor class like this:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>${project.java.version}</source>
                    <target>${project.java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <!--<compilerArgument>-proc:none</compilerArgument>-->
                    <annotationProcessors>
                        <annotationProcessor>lombok.launch.AnnotationProcessorHider$AnnotationProcessor</annotationProcessor>
                    </annotationProcessors>
                </configuration>
            </plugin>

The problem was solved. Thank you so much.

All 7 comments

We've changed the classloading infrastructure inside our jar between those versions.

The correct annotation processor class has changed to:

lombok.launch.AnnotationProcessorHider$AnnotationProcessor

Try putting that string in the XML at location: plugins/plugin [maven-compiler-plugin]/configuration/annotationProcessors/annotationProcessor.

If this does not work, please re-open the issue.

When i change AnnotationProcessor class like this:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>${project.java.version}</source>
                    <target>${project.java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <!--<compilerArgument>-proc:none</compilerArgument>-->
                    <annotationProcessors>
                        <annotationProcessor>lombok.launch.AnnotationProcessorHider$AnnotationProcessor</annotationProcessor>
                    </annotationProcessors>
                </configuration>
            </plugin>

The problem was solved. Thank you so much.

I accidentally discovered this same solution to my problem as well.

I am going to paste the error that might lead future googlers to right information.

maven lombok cannot find symbol method

if anyone still looking for right answer, here it is ;)

link: https://github.com/jhipster/generator-jhipster/issues/5942#issuecomment-335002220

how to add this in a sbt project ?

I am still getting error, don't know what is going wrong.Please help

Please correct your pom file. As per https://projectlombok.org/setup/maven
the correct bit of maven compiler plugin configuration looks like this:



org.projectlombok
lombok
1.18.12

On Tue, Aug 25, 2020, 12:25 Shreyar20 notifications@github.com wrote:

I am still getting error, don't know what is going wrong.Please help

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/rzwitserloot/lombok/issues/905#issuecomment-679941073,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AABIERIZCS5KACXZ4Z3ZUMTSCOGSRANCNFSM4BOM65VA
.

Was this page helpful?
0 / 5 - 0 ratings