@@ -6208,13 +6208,21 @@ class annotated with `@SpringBootApplication` or `@SpringBootConfiguration`. As
6208
6208
you <<using-boot-structuring-your-code, structured your code>> in a sensible way, your
6209
6209
main configuration is usually found.
6210
6210
6211
- NOTE: If you use a
6211
+ [NOTE]
6212
+ ====
6213
+ If you use a
6212
6214
<<boot-features-testing-spring-boot-applications-testing-autoconfigured-tests, test
6213
6215
annotation to test a more specific slice of your application>>, you should avoid adding
6214
6216
configuration settings that are specific to a particular area on the
6215
6217
<<boot-features-testing-spring-boot-applications-testing-user-configuration, main
6216
6218
method's application class>>.
6217
6219
6220
+ The underlying component scan configuration of `@SpringBootApplication` defines exclude
6221
+ filters that are used to make sure slicing works as expected. If you are using an explicit
6222
+ `@ComponentScan` directive on your `@SpringBootApplication`-annoted class, be aware that
6223
+ those filters will be disabled. If you are using slicing, you should define them again.
6224
+ ====
6225
+
6218
6226
If you want to customize the primary configuration, you can use a nested
6219
6227
`@TestConfiguration` class. Unlike a nested `@Configuration` class, which would be used
6220
6228
instead of your application's primary configuration, a nested `@TestConfiguration` class
@@ -7721,6 +7729,41 @@ TIP: You should mark the dependencies to the library as optional so that you can
7721
7729
the `autoconfigure` module in your projects more easily. If you do it that way, the
7722
7730
library is not provided and, by default, Spring Boot backs off.
7723
7731
7732
+ Spring Boot uses an annotation processor to collect the conditions on auto-configurations
7733
+ in a metadata file (`META-INF/spring-autoconfigure-metadata.json`). If that file is
7734
+ present, it is used to eagerly filter auto-configurations that do not match, which will
7735
+ improve startup time. It is recommended to add the following dependency in a module that
7736
+ contains auto-configurations:
7737
+
7738
+ [source,xml,indent=0,subs="verbatim,quotes,attributes"]
7739
+ ----
7740
+ <dependency>
7741
+ <groupId>org.springframework.boot</groupId>
7742
+ <artifactId>spring-boot-autoconfigure-processor</artifactId>
7743
+ <optional>true</optional>
7744
+ </dependency>
7745
+ ----
7746
+
7747
+ With Gradle 4.5 and earlier, the dependency should be declared in the `compileOnly`
7748
+ configuration, as shown in the following example:
7749
+
7750
+ [source,groovy,indent=0,subs="verbatim,quotes,attributes"]
7751
+ ----
7752
+ dependencies {
7753
+ compileOnly "org.springframework.boot:spring-boot-autoconfigure-processor"
7754
+ }
7755
+ ----
7756
+
7757
+ With Gradle 4.6 and later, the dependency should be declared in the `annotationProcessor`
7758
+ configuration, as shown in the following example:
7759
+
7760
+ [source,groovy,indent=0,subs="verbatim,quotes,attributes"]
7761
+ ----
7762
+ dependencies {
7763
+ annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor"
7764
+ }
7765
+ ----
7766
+
7724
7767
7725
7768
7726
7769
[[boot-features-custom-starter-module-starter]]
0 commit comments