Skip to content

Commit d0b71a7

Browse files
committed
Document usage of auto-configuration AP for 3rd party starters
Closes gh-13368
1 parent 6c7289b commit d0b71a7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6490,6 +6490,30 @@ TIP: You should mark the dependencies to the library as optional so that you can
64906490
the autoconfigure module in your projects more easily. If you do it that way, the library
64916491
won't be provided and Spring Boot will back off by default.
64926492

6493+
Spring Boot uses an annotation processor to collect the conditions on auto-configurations
6494+
in a metadata file (`META-INF/spring-autoconfigure-metadata.json`). If that file is
6495+
present, it is used to eagerly filter auto-configurations that do not match, which will
6496+
improve startup time. It is recommended to add the following dependency in a module that
6497+
contains auto-configurations:
6498+
6499+
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
6500+
----
6501+
<dependency>
6502+
<groupId>org.springframework.boot</groupId>
6503+
<artifactId>spring-boot-autoconfigure-processor</artifactId>
6504+
<optional>true</optional>
6505+
</dependency>
6506+
----
6507+
6508+
With Gradle you would add:
6509+
6510+
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
6511+
----
6512+
dependencies {
6513+
compileOnly "org.springframework.boot:spring-boot-autoconfigure-processor"
6514+
}
6515+
----
6516+
64936517

64946518

64956519
[[boot-features-custom-starter-module-starter]]

0 commit comments

Comments
 (0)