From 584d2de9f3f11912a2f585ec67bab2a7862be685 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 6 Jun 2018 10:53:55 +0200 Subject: [PATCH] Document use of component scan exclude filters on SpringBootApplication Closes gh-10933 --- .../src/main/asciidoc/spring-boot-features.adoc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index bf445cc119..59300cdf72 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -5421,13 +5421,21 @@ The search algorithm works up from the package that contains the test until it f <> in a sensible way your main configuration is usually found. -NOTE: If you use a +[NOTE] +==== +If you use a <> with such setup, you should avoid adding configuration that are specific to a particular area on the <>. +The underlying component scan configuration of `@SpringBootApplication` defines exclude +filters that are used to make sure slicing works as expected. If you are using an explicit +`@ComponentScan` directive on your `@SpringBootApplication`-annoted class, be aware that +those filters will be disabled. If you are using slicing, you should define them again. +==== + If you want to customize the primary configuration, you can use a nested `@TestConfiguration` class. Unlike a nested `@Configuration` class which would be used instead of a your application's primary configuration, a nested `@TestConfiguration` class