Skip to content

Commit f6c9936

Browse files
committed
Merge branch '1.5.x' into 2.0.x
2 parents 9f16326 + 584d2de commit f6c9936

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

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

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6176,13 +6176,21 @@ class annotated with `@SpringBootApplication` or `@SpringBootConfiguration`. As
61766176
you <<using-boot-structuring-your-code, structured your code>> in a sensible way, your
61776177
main configuration is usually found.
61786178

6179-
NOTE: If you use a
6179+
[NOTE]
6180+
====
6181+
If you use a
61806182
<<boot-features-testing-spring-boot-applications-testing-autoconfigured-tests, test
61816183
annotation to test a more specific slice of your application>>, you should avoid adding
61826184
configuration settings that are specific to a particular area on the
61836185
<<boot-features-testing-spring-boot-applications-testing-user-configuration, main
61846186
method's application class>>.
61856187
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+
61866194
If you want to customize the primary configuration, you can use a nested
61876195
`@TestConfiguration` class. Unlike a nested `@Configuration` class, which would be used
61886196
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
76447652
the `autoconfigure` module in your projects more easily. If you do it that way, the
76457653
library is not provided and, by default, Spring Boot backs off.
76467654

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+
76477690

76487691

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

0 commit comments

Comments
 (0)