Adetayo Akinsanya unkletayo.dev

Why Spring Boot Exists: Eliminating XML Configuration and Dependency Hell

Understanding the evolution from 500-line XML bean definitions and transitive dependency conflicts to Spring Boot auto-configuration

Adetayo Akinsanya (unkletayo) 2026-09-11

Part 8 in Series — Catch up on the previous article: The Complete Spring Bean Lifecycle: Instantiation, Dependency Injection, Init, and Destroy (Part 7) before diving into this post.

Why You Need This in Real Life

Deploying an enterprise payment service in 2012 required spending three days constructing a 600-line applicationContext.xml configuration file before writing a single line of business logic. You manually defined bean tags for data sources, transaction managers, entity managers, session factories, and HTTP converters:

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://localhost:3306/payments" />
    <property name="username" value="root" />
    <property name="password" value="secret" />
</bean>

<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
    <property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>

When you updated Jackson from version 2.2.0 to 2.4.0 in your pom.xml, the application crashed on startup with java.lang.NoSuchMethodError because a transitive dependency pulled in an incompatible version of jackson-core. To deploy the app, you had to package it as a .war file, install Apache Tomcat on a dedicated Linux server, configure XML context descriptors in Tomcat’s /conf directory, and copy your WAR to /webapps.

Spring Boot was created to eliminate this operational nightmare. Understanding why Spring Boot exists—and what problems it solves—prevents treating it as a black magic framework.


The Legacy Spring Configuration Pain Points

1. XML Configuration Explosion

In early Spring applications, application assembly was strictly separated from Java code using XML files. While this allowed changing bean wiring without recompiling Java classes, it introduced severe friction:

  • No Compile-Time Type Checking: Bean class names and property names were written as raw strings. Typos caused runtime errors during startup.
  • Refactoring Fragility: Renaming a Java class or field broke XML wiring silently unless IDE refactoring plugins caught every string reference.
  • Configuration Duplication: Every new service required repeating dozens of boilerplate bean definitions for standard infrastructure (JDBC, Hibernate, MVC views).
+-------------------------------------------------------------------+
|                     Legacy Spring (Pre-Boot)                      |
|                                                                   |
|   +-------------------+    +----------------------------------+   |
|   |  applicationContext |    |      Transitive JAR Dependencies  |   |
|   |  .xml (600+ lines)|    |  (Version Conflicts & Mismatches)|   |
|   +---------+---------+    +----------------+-----------------+   |
|             |                               |                     |
|             v                               v                     |
|   +-----------------------------------------------------------+   |
|   |                 Manual WAR Packaging                      |   |
|   +-----------------------------+-----------------------------+   |
|                                 |                                 |
|                                 v                                 |
|   +-----------------------------------------------------------+   |
|   |            External Tomcat Application Server             |   |
|   +-----------------------------------------------------------+   |
+-------------------------------------------------------------------+

2. Dependency Hell & Version Matrix Compatibility

Before Spring Boot starter POMs, configuring a stack like Spring Web + Hibernate + Jackson required explicitly declaring 15 to 20 individual Maven dependencies:

  • spring-webmvc
  • spring-orm
  • hibernate-core
  • jackson-databind
  • commons-dbcp

Developers spent hours resolving transitive dependency conflicts where hibernate-core 4.2 required jboss-logging 3.1.0 while another library pulled in jboss-logging 3.3.0.


How Spring Boot Solves Legacies Problems

Spring Boot introduced three architectural innovations:

1. Starter Dependencies (BOM - Bill of Materials)

Spring Boot provides curated dependency bundles called Starters (e.g., spring-boot-starter-web, spring-boot-starter-data-jpa). Each starter imports a verified set of compatible libraries defined in spring-boot-dependencies.

Instead of managing 20 library versions, you declare a single parent POM version:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.2.0</version>
</parent>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
</dependencies>

Spring Boot automatically manages compatible versions for Jackson, Tomcat, Spring MVC, and Hibernate.

2. Auto-Configuration Paradigm

Instead of forcing developers to define beans explicitly, Spring Boot analyzes the classpath at startup and automatically configures standard beans if they are missing.

If h2.jar is on the classpath and no custom DataSource bean exists, Spring Boot automatically creates an in-memory H2 DataSource bean.

+-------------------------------------------------------------------+
|                        Spring Boot Era                            |
|                                                                   |
|   +-----------------------+     +-----------------------------+   |
|   | spring-boot-starter  |     |  Classpath Condition Checks  |   |
|   |  -web (Curated BOM)   |     | (@ConditionalOnClass/Bean)  |   |
|   +-----------+-----------+     +--------------+--------------+   |
|               |                                |                  |
|               +----------------+---------------+                  |
|                                |                                  |
|                                v                                  |
|   +-----------------------------------------------------------+   |
|   |             Auto-Configured Beans Infrastructure           |   |
|   +----------------------------+------------------------------+   |
|                                |                                  |
|                                v                                  |
|   +-----------------------------------------------------------+   |
|   |             Executable Fat JAR (Embedded Tomcat)          |   |
|   +-----------------------------------------------------------+   |
+-------------------------------------------------------------------+

3. Executable Fat JARs & Embedded Web Servers

Spring Boot inverted the deployment model. Rather than deploying an application WAR file into an external web server, Spring Boot embeds the web server (Apache Tomcat, Eclipse Jetty, or Undertow) directly inside the executable application JAR.

Executing java -jar application.jar boots the embedded web server in milliseconds without server installations.


Comparing Modern Configuration Approaches

StrategyWiring MechanismMain Friction / Tradeoff
XML Wiring (Spring 2.x)<bean class="..."> tag in XMLNo compile-time checks, verbose XML files.
Annotation Wiring (Spring 3.x)@Configuration, @Bean, @ComponentLess XML, but infrastructure beans still manually declared.
Auto-Configuration (Spring Boot)Classpath scanning + Conditional evaluationRapid setup; requires understanding conditional bean evaluation.

Next Steps

Now that we understand the historical rationale behind Spring Boot, we will explore the exact mechanics of auto-configuration: @EnableAutoConfiguration, @ConditionalOnClass, and META-INF/spring.factories / AutoConfiguration.imports.

References & Further Reading

  1. Spring.io. Spring Boot Reference Guide — Creating Your Own Auto-configuration. Spring Docs.
  2. Spring.io GitHub. Spring Boot Source Code: SpringFactoriesLoader.java & @EnableAutoConfiguration. GitHub.
  3. Webb, P., et al. (2023). Spring Boot Documentation. VMware Tanzu.

Up Next in Series →

Part 9: Spring Boot Auto-Configuration Under the Hood: @EnableAutoConfiguration and Conditional Annotations

Continue to Part 9 →