Spring Boot’s auto-configuration system is the engine behind convention-over-configuration: it inspects the libraries on your classpath, the beans already defined in your application context, and a set of environment properties, then automatically registers exactly the infrastructure beans your application needs — without requiring any explicitDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/spring-projects/spring-boot/llms.txt
Use this file to discover all available pages before exploring further.
@Bean declarations from you. Understanding how this mechanism works lets you extend it, override it, and debug it when something does not behave as expected.
How auto-configuration works
Auto-configuration classes are regular@Configuration classes annotated with @AutoConfiguration. Spring Boot discovers them at startup by reading every META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports file found on the classpath. Each line in that file is a fully-qualified class name of an auto-configuration class to consider.
META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
To see which auto-configurations are active (or inactive, and why), start your application with
--debug or -Ddebug=true. The conditions report printed to the log shows every auto-configuration class, which conditions passed, and which conditions caused it to be skipped. In an Actuator application, you can also query the /actuator/conditions endpoint at runtime.The @AutoConfiguration annotation
@AutoConfiguration is a composed annotation that combines @Configuration(proxyBeanMethods = false) with auto-configuration-specific metadata. Disabling CGLIB proxying is the default because auto-configuration classes are typically infrastructure configuration that does not need full proxy semantics.
Ordering auto-configurations
Auto-configurations can declare ordering constraints to ensure that one configuration runs before or after another:@AutoConfiguration(after = X.class)— equivalent to@AutoConfigureAfter. Ensures this class is processed afterX.@AutoConfiguration(before = X.class)— equivalent to@AutoConfigureBefore. Ensures this class is processed beforeX.
@DependsOn or @Order on the beans themselves.
Conditional annotations
Auto-configurations use conditional annotations to activate only when the right conditions are met. Stacking multiple@Conditional* annotations requires all conditions to pass.
| Annotation | Activates when… |
|---|---|
@ConditionalOnClass | All listed classes are on the classpath. |
@ConditionalOnMissingClass | None of the listed classes are on the classpath. |
@ConditionalOnBean | A bean of the given type or name already exists. |
@ConditionalOnMissingBean | No bean of the given type or name exists (lets users override). |
@ConditionalOnProperty | A configuration property has a specific value. |
@ConditionalOnResource | A specific resource is present on the classpath. |
@ConditionalOnWebApplication | The application is a web application. |
@ConditionalOnNotWebApplication | The application is not a web application. |
@ConditionalOnSingleCandidate | Exactly one candidate bean of the given type exists. |
@ConditionalOnExpression | A SpEL expression evaluates to true. |
Disabling specific auto-configurations
You can exclude auto-configurations you do not want:- @SpringBootApplication
- properties
Auto-configuration classes by category
The classes below are read from theMETA-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports files in the Spring Boot source. Only selected, commonly used classes are listed here; run --debug to see the complete list for your application.
Core
Core
These auto-configurations are always considered regardless of which starters are on the classpath.
| Class | Purpose |
|---|---|
org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration | Enables @ConfigurationProperties bean processing. |
org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration | Auto-configures MessageSource for internationalization. |
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration | Registers a PropertySourcesPlaceholderConfigurer for ${…} resolution. |
org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration | Configures an AsyncTaskExecutor for @Async and virtual threads. |
org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration | Configures a ThreadPoolTaskScheduler for @Scheduled. |
org.springframework.boot.autoconfigure.aop.AopAutoConfiguration | Enables Spring AOP via @EnableAspectJAutoProxy. |
org.springframework.boot.autoconfigure.ssl.SslAutoConfiguration | Registers SSL bundles from spring.ssl.bundle.* properties. |
Web (Servlet and Reactive)
Web (Servlet and Reactive)
Web auto-configurations set up the dispatcher, error handling, HTTP encoding, and view technologies.
| Class | Purpose |
|---|---|
org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration | Registers DispatcherServlet for Spring MVC. |
org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration | Configures Spring MVC defaults (content negotiation, formatters, static resources). |
org.springframework.boot.webmvc.autoconfigure.error.ErrorMvcAutoConfiguration | Provides the default /error endpoint and BasicErrorController. |
org.springframework.boot.servlet.autoconfigure.HttpEncodingAutoConfiguration | Sets the character encoding for HTTP requests and responses. |
org.springframework.boot.servlet.autoconfigure.MultipartAutoConfiguration | Configures multipart file upload support. |
org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration | Configures Spring WebFlux for reactive web applications. |
org.springframework.boot.webflux.autoconfigure.error.ErrorWebFluxAutoConfiguration | Provides reactive error handling via DefaultErrorWebExceptionHandler. |
org.springframework.boot.thymeleaf.autoconfigure.ThymeleafAutoConfiguration | Configures Thymeleaf template engine and view resolver. |
org.springframework.boot.freemarker.autoconfigure.FreeMarkerAutoConfiguration | Configures FreeMarker template engine. |
org.springframework.boot.restclient.autoconfigure.RestClientAutoConfiguration | Configures RestClient.Builder with default settings. |
org.springframework.boot.restclient.autoconfigure.RestTemplateAutoConfiguration | Configures RestTemplateBuilder for RestTemplate creation. |
org.springframework.boot.webclient.autoconfigure.WebClientAutoConfiguration | Configures WebClient.Builder for reactive HTTP clients. |
org.springframework.boot.graphql.autoconfigure.GraphQlAutoConfiguration | Configures Spring for GraphQL schema and execution. |
org.springframework.boot.graphql.autoconfigure.servlet.GraphQlWebMvcAutoConfiguration | Exposes GraphQL over HTTP in servlet applications. |
Data (JDBC, JPA, NoSQL)
Data (JDBC, JPA, NoSQL)
Data auto-configurations cover relational and NoSQL databases, connection pooling, and Spring Data repositories.
| Class | Purpose |
|---|---|
org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration | Configures a DataSource (defaults to HikariCP). |
org.springframework.boot.jdbc.autoconfigure.JdbcTemplateAutoConfiguration | Configures JdbcTemplate and NamedParameterJdbcTemplate. |
org.springframework.boot.jdbc.autoconfigure.JdbcClientAutoConfiguration | Configures the fluent JdbcClient API. |
org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConfiguration | Configures DataSourceTransactionManager for JDBC. |
org.springframework.boot.hibernate.autoconfigure.HibernateJpaAutoConfiguration | Configures Hibernate as the JPA provider. |
org.springframework.boot.data.jpa.autoconfigure.DataJpaRepositoriesAutoConfiguration | Enables @EnableJpaRepositories for Spring Data JPA. |
org.springframework.boot.data.jdbc.autoconfigure.DataJdbcRepositoriesAutoConfiguration | Enables Spring Data JDBC repositories. |
org.springframework.boot.mongodb.autoconfigure.MongoAutoConfiguration | Configures a MongoDB MongoClient. |
org.springframework.boot.data.mongodb.autoconfigure.DataMongoAutoConfiguration | Configures MongoDB template and repositories. |
org.springframework.boot.data.redis.autoconfigure.DataRedisAutoConfiguration | Configures RedisTemplate and StringRedisTemplate. |
org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration | Configures Flyway database migration. |
org.springframework.boot.liquibase.autoconfigure.LiquibaseAutoConfiguration | Configures Liquibase database migration. |
org.springframework.boot.r2dbc.autoconfigure.R2dbcAutoConfiguration | Configures a reactive R2DBC ConnectionFactory. |
org.springframework.boot.data.elasticsearch.autoconfigure.DataElasticsearchAutoConfiguration | Configures Elasticsearch client and template. |
org.springframework.boot.data.neo4j.autoconfigure.DataNeo4jAutoConfiguration | Configures Neo4j driver and template. |
org.springframework.boot.jooq.autoconfigure.JooqAutoConfiguration | Configures jOOQ DSLContext. |
Security
Security
Security auto-configurations set up Spring Security’s filter chain, user details, OAuth2, and SAML2.
| Class | Purpose |
|---|---|
org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration | Registers the default SpringBootWebSecurityConfiguration and AuthenticationEventPublisher. |
org.springframework.boot.security.autoconfigure.UserDetailsServiceAutoConfiguration | Configures an in-memory UserDetailsService with a generated password (for development). |
org.springframework.boot.security.autoconfigure.web.servlet.ServletWebSecurityAutoConfiguration | Enables @EnableWebSecurity in servlet applications. |
org.springframework.boot.security.autoconfigure.web.reactive.ReactiveWebSecurityAutoConfiguration | Enables @EnableWebFluxSecurity in reactive applications. |
org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration | Configures OAuth2 / OpenID Connect client support. |
org.springframework.boot.security.oauth2.server.resource.autoconfigure.OAuth2ResourceServerAutoConfiguration | Configures JWT or opaque-token resource server validation. |
org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet.OAuth2AuthorizationServerAutoConfiguration | Configures Spring Authorization Server. |
org.springframework.boot.security.saml2.autoconfigure.Saml2RelyingPartyAutoConfiguration | Configures SAML 2.0 relying party (service provider). |
Messaging
Messaging
Messaging auto-configurations support AMQP (RabbitMQ), Kafka, JMS, Pulsar, and other messaging systems.
| Class | Purpose |
|---|---|
org.springframework.boot.amqp.autoconfigure.RabbitAutoConfiguration | Configures RabbitMQ ConnectionFactory, RabbitTemplate, and listener containers. |
org.springframework.boot.kafka.autoconfigure.KafkaAutoConfiguration | Configures Kafka KafkaTemplate, producer, consumer, and admin. |
org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration | Configures JMS JmsTemplate and listener container factory. |
org.springframework.boot.activemq.autoconfigure.ActiveMQAutoConfiguration | Configures ActiveMQ Classic connection factory. |
org.springframework.boot.artemis.autoconfigure.ArtemisAutoConfiguration | Configures ActiveMQ Artemis connection factory. |
org.springframework.boot.pulsar.autoconfigure.PulsarAutoConfiguration | Configures Apache Pulsar client, producer, and consumer. |
org.springframework.boot.rsocket.autoconfigure.RSocketServerAutoConfiguration | Configures an RSocket server. |
org.springframework.boot.integration.autoconfigure.IntegrationAutoConfiguration | Configures Spring Integration message infrastructure. |
Actuator and observability
Actuator and observability
Actuator auto-configurations expose production-ready endpoints. Observability auto-configurations integrate Micrometer metrics, tracing, and OpenTelemetry.
| Class | Purpose |
|---|---|
org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration | Core endpoint infrastructure (discovery, caching, security). |
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration | Exposes endpoints over HTTP. |
org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration | Configures the /actuator/health endpoint. |
org.springframework.boot.health.autoconfigure.application.DiskSpaceHealthContributorAutoConfiguration | Adds a disk-space health indicator. |
org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointAutoConfiguration | Configures the /actuator/env endpoint. |
org.springframework.boot.actuate.autoconfigure.logging.LoggersEndpointAutoConfiguration | Configures the /actuator/loggers endpoint for runtime log-level changes. |
org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration | Configures the /actuator/beans endpoint. |
org.springframework.boot.micrometer.metrics.autoconfigure.MetricsAutoConfiguration | Configures the Micrometer MeterRegistry. |
org.springframework.boot.micrometer.metrics.autoconfigure.export.prometheus.PrometheusMetricsExportAutoConfiguration | Exposes metrics in Prometheus format via /actuator/prometheus. |
org.springframework.boot.micrometer.observation.autoconfigure.ObservationAutoConfiguration | Configures Micrometer ObservationRegistry for unified observability. |
org.springframework.boot.micrometer.tracing.autoconfigure.MicrometerTracingAutoConfiguration | Integrates distributed tracing with Micrometer Tracing. |
org.springframework.boot.micrometer.tracing.brave.autoconfigure.BraveAutoConfiguration | Configures Brave as the Micrometer Tracing implementation. |
org.springframework.boot.opentelemetry.autoconfigure.OpenTelemetrySdkAutoConfiguration | Configures the OpenTelemetry SDK. |
Caching and task execution
Caching and task execution
| Class | Purpose |
|---|---|
org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration | Configures Spring’s CacheManager (auto-detects Caffeine, Redis, EhCache, etc.). |
org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration | Configures the application TaskExecutor used for @Async and virtual threads. |
org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration | Configures ThreadPoolTaskScheduler for @Scheduled methods. |
org.springframework.boot.quartz.autoconfigure.QuartzAutoConfiguration | Configures the Quartz Scheduler with JDBC or in-memory job stores. |
org.springframework.boot.batch.autoconfigure.BatchAutoConfiguration | Configures Spring Batch infrastructure (job repository, launcher). |
Writing your own auto-configuration
To package reusable auto-configuration as a library, create an@AutoConfiguration class and register it in your JAR’s META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports file:
META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports