Skip to content

Commit f5a4bf0

Browse files
committed
Merge branch '3.3.x'
Closes gh-43544
2 parents a84e65f + 4763123 commit f5a4bf0

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/developing-auto-configuration.adoc

+7-18
Original file line numberDiff line numberDiff line change
@@ -303,34 +303,23 @@ If you do it that way, the library is not provided and, by default, Spring Boot
303303
Spring Boot uses an annotation processor to collect the conditions on auto-configurations in a metadata file (`META-INF/spring-autoconfigure-metadata.properties`).
304304
If that file is present, it is used to eagerly filter auto-configurations that do not match, which will improve startup time.
305305

306-
When building with Maven, it is recommended to add the following dependency in a module that contains auto-configurations:
307-
308-
[source,xml]
309-
----
310-
<dependency>
311-
<groupId>org.springframework.boot</groupId>
312-
<artifactId>spring-boot-autoconfigure-processor</artifactId>
313-
<optional>true</optional>
314-
</dependency>
315-
----
316-
317-
If you have defined auto-configurations directly in your application, make sure to configure the `spring-boot-maven-plugin` to prevent the `repackage` goal from adding the dependency into the uber jar:
306+
When building with Maven, configure the compiler plugin (3.12.0 or later) to add `spring-boot-autoconfigure-processor` to the annotation processor paths:
318307

319308
[source,xml]
320309
----
321310
<project>
322311
<build>
323312
<plugins>
324313
<plugin>
325-
<groupId>org.springframework.boot</groupId>
326-
<artifactId>spring-boot-maven-plugin</artifactId>
314+
<groupId>org.apache.maven.plugins</groupId>
315+
<artifactId>maven-compiler-plugin</artifactId>
327316
<configuration>
328-
<excludes>
329-
<exclude>
317+
<annotationProcessorPaths>
318+
<path>
330319
<groupId>org.springframework.boot</groupId>
331320
<artifactId>spring-boot-autoconfigure-processor</artifactId>
332-
</exclude>
333-
</excludes>
321+
</path>
322+
</annotationProcessorPaths>
334323
</configuration>
335324
</plugin>
336325
</plugins>

spring-boot-project/spring-boot-docs/src/docs/antora/modules/specification/pages/configuration-metadata/annotation-processor.adoc

+22-11
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,31 @@ The jar includes a Java annotation processor which is invoked as your project is
99
[[appendix.configuration-metadata.annotation-processor.configuring]]
1010
== Configuring the Annotation Processor
1111

12-
To use the processor, include a dependency on `spring-boot-configuration-processor`.
13-
14-
With Maven the dependency should be declared as optional, as shown in the following example:
12+
When building with Maven, configure the compiler plugin (3.12.0 or later) to add `spring-boot-configuration-processor` to the annotation processor paths:
1513

1614
[source,xml]
1715
----
18-
<dependency>
19-
<groupId>org.springframework.boot</groupId>
20-
<artifactId>spring-boot-configuration-processor</artifactId>
21-
<optional>true</optional>
22-
</dependency>
16+
<project>
17+
<build>
18+
<plugins>
19+
<plugin>
20+
<groupId>org.apache.maven.plugins</groupId>
21+
<artifactId>maven-compiler-plugin</artifactId>
22+
<configuration>
23+
<annotationProcessorPaths>
24+
<path>
25+
<groupId>org.springframework.boot</groupId>
26+
<artifactId>spring-boot-configuration-processor</artifactId>
27+
</path>
28+
</annotationProcessorPaths>
29+
</configuration>
30+
</plugin>
31+
</plugins>
32+
</build>
33+
</project>
2334
----
2435

25-
With Gradle, the dependency should be declared in the `annotationProcessor` configuration, as shown in the following example:
36+
With Gradle, a dependency should be declared in the `annotationProcessor` configuration, as shown in the following example:
2637

2738
[source,gradle]
2839
----
@@ -64,8 +75,8 @@ You could also let the AspectJ plugin run all the processing and disable annotat
6475
[NOTE]
6576
====
6677
If you are using Lombok in your project, you need to make sure that its annotation processor runs before `spring-boot-configuration-processor`.
67-
To do so with Maven, you can list the annotation processors in the right order using the `annotationProcessors` attribute of the Maven compiler plugin.
68-
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.
78+
To do so with Maven, list the annotation processors in the required order using the `annotationProcessors` attribute of the Maven compiler plugin.
79+
With Gradle, declare the dependencies in the `annotationProcessor` configuration in the required order.
6980
====
7081

7182

0 commit comments

Comments
 (0)