adamCH
adamCH

Reputation: 11

Lombok plugin fails to generate getter methods

IDE:IntelliJ IDEA 2020.3.2 (Ultimate Edition)
Play:1.4.4
Lombok:1.18.18
Exception:play.exceptions.CompilationException: The method getId() is undefined for the type Order
        at play.classloading.ApplicationCompiler$2.acceptResult(ApplicationCompiler.java:264)
        at org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:678)
        at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:522)
        at play.classloading.ApplicationCompiler.compile(ApplicationCompiler.java:300)
        at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:420)
        at play.classloading.ApplicationClassloader.getAssignableClasses(ApplicationClassloader.java:466)
        at play.templates.GroovyTemplateCompiler.endTag(GroovyTemplateCompiler.java:362)
        at play.templates.TemplateCompiler.generate(TemplateCompiler.java:93)
        at play.templates.TemplateCompiler.compile(TemplateCompiler.java:15)
        at play.templates.GroovyTemplateCompiler.compile(GroovyTemplateCompiler.java:39)
        at play.templates.TemplateCompiler.compile(TemplateCompiler.java:28)
        at play.templates.TemplateLoader.load(TemplateLoader.java:85)
        at play.templates.TemplateLoader.load(TemplateLoader.java:180)
        at play.server.PlayHandler.serve500(PlayHandler.java:836)
        at Invocation.HTTP Request(Play!)

I already checked the settings here, but that didn't fix the problem: Java Compiler Setting Annotation Processors Setting Intellij Plugins

Upvotes: 1

Views: 253

Answers (2)

R. Du
R. Du

Reputation: 633

I managed to make it work on a gradle project (Intellij 2020.3.2) by using exactly this in build.gradle :

annotationProcessor 'org.projectlombok:lombok'

I think important point is to declare it as "annotationProcessor" type and not "compile" or so.

Upvotes: 1

adamCH
adamCH

Reputation: 11

if someone gets the same issues, I found the answer

just keep the IntelliJ setting all the right

then I trying to change the Lombok version

Playframework - 1.4.4
Lombok - 1.18.2
IntelliJ - 2020.3
IntelliJ Plugins - Lombok 0.32-EAP

that's work ...

Upvotes: 0

Related Questions