8

I opened the restbucks project with Intellij. I have lombok plugin installed, annotation processing enabled. I am using javac compiler in Intellij settings. I have lombok.config in project root like in git repository, I also tried copying it to src/main/java and src/main/resources but no matter what I try, when I build the project with Intellij, after posting an order, I get:

Argument #0 of constructor [constructor for org.springsource.restbucks.order.Order, annotations: {interface com.fasterxml.jackson.annotation.JsonCreator=@com.fasterxml.jackson.annotation.JsonCreator(mode=DEFAULT)}] has no property name annotation; must have name when multiple-parameter constructor annotated as Creator

Seems like lombok.anyConstructor.suppressConstructorProperties=true has no effect. When I build with maven then it works fine. When I delete the lombok.config file, Intellij starts showing errors all over the project so the file seems to be recognized by Intellij afterall. But the build doesn't run as expected as posting to orders fails as mentioned above. Does anyone know what's going on here?

aycanadal
  • 1,106
  • 2
  • 15
  • 42

1 Answers1

1

Lombok plugin does support lombok.config file.

The lombok.anyConstructor.suppressConstructorProperties is deprecated as per in Lombok doc

BREAKING CHANGE: lombok config key lombok.anyConstructor.suppressConstructorProperties is now deprecated and defaults to true, that is, by default lombok no longer automatically generates @ConstructorProperties annotations. New config key lombok.anyConstructor.addConstructorProperties now exist; set it to true if you want the old behavior. Oracle more or less broke this annotation with the release of JDK9, necessitating this breaking change.

Use the new lombok.anyConstructor.addConstructorProperties in the lombok.config located in the root folder and also, perform a clean install and then should be fine.