Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation processor 'lombok.core.AnnotationProcessor' not found #905

Closed
lalib opened this issue Aug 27, 2015 · 8 comments
Closed

Annotation processor 'lombok.core.AnnotationProcessor' not found #905

lalib opened this issue Aug 27, 2015 · 8 comments
Labels

Comments

@lalib
Copy link

lalib commented Aug 27, 2015

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?

@rzwitserloot
Copy link
Collaborator

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.

@lalib
Copy link
Author

lalib commented Aug 31, 2015

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.

@mnukka
Copy link

mnukka commented Apr 20, 2017

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

@chlegou
Copy link

chlegou commented Jun 17, 2019

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

link: jhipster/generator-jhipster#5942 (comment)

@mcherb
Copy link

mcherb commented Jan 17, 2020

how to add this in a sbt project ?

@Shreyar20
Copy link

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

@randakar
Copy link

randakar commented Aug 25, 2020 via email

@robert-gdv
Copy link

@rzwitserloot : Why did you hide it, if this kind of setting requires a simple stable path?
Or do you recommend a totally differnt way to handle the sequence of annotation preprocessors with maven-compile-plugin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants