Add `spring.autoconfigure.exclude` to control the list of
auto-configuration classes to exclude via configuration. Merge the
exclusions defined on the `@EnableAutoConfiguration` or
`@SpringBooApplication` if any.
Closes gh-2435
@ -63,12 +68,13 @@ public class EnableAutoConfigurationImportSelectorTests {
@@ -63,12 +68,13 @@ public class EnableAutoConfigurationImportSelectorTests {
@ -102,9 +108,22 @@ public class EnableAutoConfigurationImportSelectorTests {
@@ -102,9 +108,22 @@ public class EnableAutoConfigurationImportSelectorTests {
@ -114,7 +133,23 @@ public class EnableAutoConfigurationImportSelectorTests {
@@ -114,7 +133,23 @@ public class EnableAutoConfigurationImportSelectorTests {
@ -123,6 +158,11 @@ public class EnableAutoConfigurationImportSelectorTests {
@@ -123,6 +158,11 @@ public class EnableAutoConfigurationImportSelectorTests {
@ -45,6 +45,9 @@ content into your application; rather pick only the properties that you need.
@@ -45,6 +45,9 @@ content into your application; rather pick only the properties that you need.
spring.main.show-banner=true
spring.main....= # see class for all properties
# AUTO-CONFIGURATION
spring.autoconfigure.exclude= # comma-separated list of auto-configuration classes to exclude
If you find that specific auto-configure classes are being applied that you don't want,
you can use the exclude attribute of `@EnableAutoConfiguration` to disable them.
@ -619,7 +619,12 @@ you can use the exclude attribute of `@EnableAutoConfiguration` to disable them.
@@ -619,7 +619,12 @@ you can use the exclude attribute of `@EnableAutoConfiguration` to disable them.
}
----
If the class is not on the classpath, you can use the `excludeName` attribute of
the annotation and specify the fully qualified name instead. Finally, you can also
control the list of auto-configuration classes to excludes via the
`spring.autoconfigure.exclude` property.
TIP: You can define exclusions both at the annotation level and using the property.