Member-only story
Can You Run Spring Boot With Zero Dependencies? I Tried It.
The itch that made me do it
I have been building Java Spring Boot applications for over five years.
Every project starts the same way:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>Then comes spring-boot-starter-data-jpa, spring-boot-starter-validation, spring-boot-starter-test, and a dozen others.
Our pom.xml becomes a proud 100-line beast.
It works, of course. Spring Boot is all about “starters” that magically pull in everything you need.
But recently, I found myself asking:
“What if I try to run a Spring Boot app with zero dependencies?
Literally nothing extra in the pom except Spring Boot itself.
Will it work? How badly will it break? Or is it even possible?”
This is the story of that silly idea, which actually taught me more about Spring Boot internals than any tutorial ever did.
Step 1: The bare minimum pom.xml
I created a brand new project:
mvn archetype:generate -DgroupId=com.example -DartifactId=zero-deps -DarchetypeArtifactId=maven-archetype-quickstartThen I replaced the generated pom.xml with this ultra-minimalist version:
<project>…