From e313aa5f6c54c313dbdcc5abb02fe45b370f38e9 Mon Sep 17 00:00:00 2001 From: tudormarc <93496164+tudormarc@users.noreply.github.com> Date: Fri, 27 May 2022 16:30:52 +0300 Subject: [PATCH 1/2] Document that Lombok must be configured before our annotation processor See gh-31190 --- .../annotation-processor.adoc | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc index fdfe8a909207..10a4f955ccd5 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc @@ -59,6 +59,29 @@ You could also let the AspectJ plugin run all the processing and disable annotat ---- ==== +[NOTE] +==== +If you are also using lombok in your project, you need to make sure that the `lombok` dependency is placed before the `spring-boot-configuration-processor` dependency. +Otherwise, combining `lombok` annotations with `spring-boot-configuration-processor` annotations will not have the desired result. + +[source,xml,indent=0,subs="verbatim"] +---- + + org.projectlombok + lombok + provided + + + ............... + + + org.springframework.boot + spring-boot-configuration-processor + true + +---- +==== + [[appendix.configuration-metadata.annotation-processor.automatic-metadata-generation]] From d896d995d1351f060e6bb8c7bc56d4376143a47d Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 13 Jun 2022 14:38:07 +0200 Subject: [PATCH 2/2] Polish contribution See gh-31190 --- .../annotation-processor.adoc | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc index 10a4f955ccd5..245669e18b85 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc @@ -61,25 +61,9 @@ You could also let the AspectJ plugin run all the processing and disable annotat [NOTE] ==== -If you are also using lombok in your project, you need to make sure that the `lombok` dependency is placed before the `spring-boot-configuration-processor` dependency. -Otherwise, combining `lombok` annotations with `spring-boot-configuration-processor` annotations will not have the desired result. - -[source,xml,indent=0,subs="verbatim"] ----- - - org.projectlombok - lombok - provided - - - ............... - - - org.springframework.boot - spring-boot-configuration-processor - true - ----- +If you are using Lombok in your project, you need to make sure that its annotation processor runs before `spring-boot-configuration-processor`. +To do so with Maven, you can list the annotation processors in the right order using the `annotationProcessors` attribute of the Maven compiler plugin. +If you are not using this attribute, and annotation processors are picked up by the dependencies available on the classpath, make sure that the `lombok` dependency is defined before the `spring-boot-configuration-processor` dependency. ====