@@ -6176,13 +6176,21 @@ class annotated with `@SpringBootApplication` or `@SpringBootConfiguration`. As
6176
6176
you <<using-boot-structuring-your-code, structured your code>> in a sensible way, your
6177
6177
main configuration is usually found.
6178
6178
6179
- NOTE: If you use a
6179
+ [NOTE]
6180
+ ====
6181
+ If you use a
6180
6182
<<boot-features-testing-spring-boot-applications-testing-autoconfigured-tests, test
6181
6183
annotation to test a more specific slice of your application>>, you should avoid adding
6182
6184
configuration settings that are specific to a particular area on the
6183
6185
<<boot-features-testing-spring-boot-applications-testing-user-configuration, main
6184
6186
method's application class>>.
6185
6187
6188
+ The underlying component scan configuration of `@SpringBootApplication` defines exclude
6189
+ filters that are used to make sure slicing works as expected. If you are using an explicit
6190
+ `@ComponentScan` directive on your `@SpringBootApplication`-annoted class, be aware that
6191
+ those filters will be disabled. If you are using slicing, you should define them again.
6192
+ ====
6193
+
6186
6194
If you want to customize the primary configuration, you can use a nested
6187
6195
`@TestConfiguration` class. Unlike a nested `@Configuration` class, which would be used
6188
6196
instead of your application's primary configuration, a nested `@TestConfiguration` class
@@ -7644,6 +7652,41 @@ TIP: You should mark the dependencies to the library as optional so that you can
7644
7652
the `autoconfigure` module in your projects more easily. If you do it that way, the
7645
7653
library is not provided and, by default, Spring Boot backs off.
7646
7654
7655
+ Spring Boot uses an annotation processor to collect the conditions on auto-configurations
7656
+ in a metadata file (`META-INF/spring-autoconfigure-metadata.json`). If that file is
7657
+ present, it is used to eagerly filter auto-configurations that do not match, which will
7658
+ improve startup time. It is recommended to add the following dependency in a module that
7659
+ contains auto-configurations:
7660
+
7661
+ [source,xml,indent=0,subs="verbatim,quotes,attributes"]
7662
+ ----
7663
+ <dependency>
7664
+ <groupId>org.springframework.boot</groupId>
7665
+ <artifactId>spring-boot-autoconfigure-processor</artifactId>
7666
+ <optional>true</optional>
7667
+ </dependency>
7668
+ ----
7669
+
7670
+ With Gradle 4.5 and earlier, the dependency should be declared in the `compileOnly`
7671
+ configuration, as shown in the following example:
7672
+
7673
+ [source,groovy,indent=0,subs="verbatim,quotes,attributes"]
7674
+ ----
7675
+ dependencies {
7676
+ compileOnly "org.springframework.boot:spring-boot-autoconfigure-processor"
7677
+ }
7678
+ ----
7679
+
7680
+ With Gradle 4.6 and later, the dependency should be declared in the `annotationProcessor`
7681
+ configuration, as shown in the following example:
7682
+
7683
+ [source,groovy,indent=0,subs="verbatim,quotes,attributes"]
7684
+ ----
7685
+ dependencies {
7686
+ annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor"
7687
+ }
7688
+ ----
7689
+
7647
7690
7648
7691
7649
7692
[[boot-features-custom-starter-module-starter]]
0 commit comments