Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
e5e497ec
Commit
e5e497ec
authored
Jan 19, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document `@ImportAutoConfiguration#exclude`
Closes gh-7862
parent
e44b595c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
ImportAutoConfiguration.java
...framework/boot/autoconfigure/ImportAutoConfiguration.java
+4
-1
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+4
-0
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfiguration.java
View file @
e5e497ec
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -31,6 +31,9 @@ import org.springframework.core.annotation.AliasFor;
* rules as {@code @EnableAutoConfiguration} but restricts the auto-configuration classes
* to the specified set, rather than consulting {@code spring.factories}.
* <p>
* Can also be used to {@link #exclude()} specific auto-configuration classes such that
* they will never be applied.
* <p>
* Generally, {@code @EnableAutoConfiguration} should be used in preference to this
* annotation, however, {@code @ImportAutoConfiguration} can be useful in some situations
* and especially when writing tests.
...
...
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
e5e497ec
...
...
@@ -5383,6 +5383,10 @@ providing a `@...Test` annotation that loads the `ApplicationContext` and one or
more `@AutoConfigure...` annotations that can be used to customize auto-configuration
settings.
NOTE: Each slice loads a very restricted set of auto-configuration classes. If you need to
exclude one of them, most `@...Test` annotation provide an `excludeAutoConfiguration`
attribute. Alternatively, you can use `@ImportAutoConfiguration#exclude`.
TIP: It's also possible to use the `@AutoConfigure...` annotations with the standard
`@SpringBootTest` annotation. You can use this combination if you're not interested
in '`slicing`' your application but you want some of the auto-configured test beans.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment