intellij-ideajava-8lombokintellij-lombok-plugin

Lombok @RequiredArgsConstructor(onConstructor_ = {@MyAnnotation}) compilation error with IntelliJ IDEA


I have following set up on my mac:

Also, I've enabled Annotation Processors as it was suggested here

But I still have following compilation error:

Cannot resolve method 'onConstructor_'

Please suggest which configurations are missing.


Solution

  • You should use onConstructor parameter like this:

    onConstructor=@__({@AnnotationsHere})
    

    See Lombok documentation:

    To put annotations on the generated constructor, you can use onConstructor=@__({@AnnotationsHere})