Exclude auto-configurations via property
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
This commit is contained in:
@@ -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
|
||||
|
||||
# ADMIN ({sc-spring-boot-autoconfigure}/admin/SpringApplicationAdminJmxAutoConfiguration.{sc-ext}[SpringApplicationAdminJmxAutoConfiguration])
|
||||
spring.application.admin.enabled=false # enable admin features for the application
|
||||
spring.application.admin.jmx-name=org.springframework.boot:type=Admin,name=SpringApplication # JMX name of the application admin MBean
|
||||
|
||||
@@ -602,7 +602,7 @@ report to the console.
|
||||
|
||||
|
||||
|
||||
[[using-boot-disabling-specific-auto-configutation]]
|
||||
[[using-boot-disabling-specific-auto-configuration]]
|
||||
=== Disabling specific auto-configuration
|
||||
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.
|
||||
}
|
||||
----
|
||||
|
||||
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.
|
||||
|
||||
[[using-boot-spring-beans-and-dependency-injection]]
|
||||
== Spring Beans and dependency injection
|
||||
|
||||
Reference in New Issue
Block a user