Skip to content

Commit 7253bb3

Browse files
committed
Merge branch '1.5.x'
2 parents 03afa0b + e5e497e commit 7253bb3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfiguration.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2016 the original author or authors.
2+
* Copyright 2012-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,6 +31,9 @@
3131
* rules as {@code @EnableAutoConfiguration} but restricts the auto-configuration classes
3232
* to the specified set, rather than consulting {@code spring.factories}.
3333
* <p>
34+
* Can also be used to {@link #exclude()} specific auto-configuration classes such that
35+
* they will never be applied.
36+
* <p>
3437
* Generally, {@code @EnableAutoConfiguration} should be used in preference to this
3538
* annotation, however, {@code @ImportAutoConfiguration} can be useful in some situations
3639
* and especially when writing tests.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5344,6 +5344,10 @@ providing a `@...Test` annotation that loads the `ApplicationContext` and one or
53445344
more `@AutoConfigure...` annotations that can be used to customize auto-configuration
53455345
settings.
53465346

5347+
NOTE: Each slice loads a very restricted set of auto-configuration classes. If you need to
5348+
exclude one of them, most `@...Test` annotation provide an `excludeAutoConfiguration`
5349+
attribute. Alternatively, you can use `@ImportAutoConfiguration#exclude`.
5350+
53475351
TIP: It's also possible to use the `@AutoConfigure...` annotations with the standard
53485352
`@SpringBootTest` annotation. You can use this combination if you're not interested
53495353
in '`slicing`' your application but you want some of the auto-configured test beans.

0 commit comments

Comments
 (0)