Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 42c2059

Browse files
committed
Merge branch '2.0.x'
2 parents 0d63e7f + f6c9936 commit 42c2059

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
@@ -6208,13 +6208,21 @@ class annotated with `@SpringBootApplication` or `@SpringBootConfiguration`. As
62086208
you <<using-boot-structuring-your-code, structured your code>> in a sensible way, your
62096209
main configuration is usually found.
62106210

6211-
NOTE: If you use a
6211+
[NOTE]
6212+
====
6213+
If you use a
62126214
<<boot-features-testing-spring-boot-applications-testing-autoconfigured-tests, test
62136215
annotation to test a more specific slice of your application>>, you should avoid adding
62146216
configuration settings that are specific to a particular area on the
62156217
<<boot-features-testing-spring-boot-applications-testing-user-configuration, main
62166218
method's application class>>.
62176219
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+
62186226
If you want to customize the primary configuration, you can use a nested
62196227
`@TestConfiguration` class. Unlike a nested `@Configuration` class, which would be used
62206228
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
77217729
the `autoconfigure` module in your projects more easily. If you do it that way, the
77227730
library is not provided and, by default, Spring Boot backs off.
77237731

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

77257768

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

0 commit comments

Comments
 (0)