Introduction to Spring Dependency Management
Learn what a "dependency" means in the Maven/Gradle sense, what Maven Central is, and why Spring Boot applications are mostly assembled from curated dependencies rather than written from scratch.
Introduction
Almost no real Spring Boot application is written entirely from scratch. Instead, developers pick a set of pre-built libraries — dependencies — that already solve common problems like talking to a database, exposing REST endpoints, sending emails, or caching data, and then wire them together with a small amount of application-specific code. Knowing which dependency to reach for, and how it works once it is on your classpath, is one of the most practical skills a Spring developer can have.
This course is a catalog: 26 lessons covering 30+ of the most commonly used Spring and Spring Boot dependencies, grouped by category (web, data, messaging, security, testing, and more). Each lesson explains the use case for a dependency, the exact Maven coordinates to add it, any minimal configuration it needs, and a working code example showing it in action.
- What a "dependency" means in the Maven/Gradle world.
- What Maven Central is and how dependencies get published there.
- Why Spring Boot apps are assembled from curated building blocks.
- How this course is organized, and what to expect from each lesson.
What is a Dependency?
In Java, a dependency is a compiled library — packaged as a JAR file — that your project relies on to compile and run. Instead of copying that library's source code into your own project, you declare a dependency on it: a build tool (Maven or Gradle) downloads the JAR, along with anything that JAR itself depends on (its "transitive" dependencies), and puts all of it on your classpath automatically.
Every dependency is identified by three coordinates: a group ID (the organization or project that publishes it, e.g. `org.springframework.boot`), an artifact ID (the specific library, e.g. `spring-boot-starter-web`), and a version (e.g. `3.2.0`). Together these three values uniquely identify one published JAR anywhere in the world.
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>Click Run to see what this code prints.
What is Maven Central?
Maven Central is the default, public repository that Maven and Gradle download dependencies from. It hosts millions of published artifacts — nearly every open-source Java library you will ever use, including everything Spring publishes. When you declare a dependency and run a build, your build tool checks Maven Central (unless you have configured a different repository) and pulls down exactly the version you asked for.
- You can browse Maven Central at mvnrepository.com or central.sonatype.com to find exact artifact coordinates and available versions.
- Once downloaded, dependencies are cached locally (in `~/.m2/repository` for Maven), so subsequent builds do not re-download them.
- Company-internal or private libraries are often published to a private, self-hosted repository (like Nexus or Artifactory) instead of the public Maven Central.
Assembling, Not Writing, Applications
Twenty years ago, a Java developer building a web application might have hand-written a good chunk of the HTTP handling, JSON parsing, and database connection pooling logic themselves. Today, all of that is a solved problem, published as a well-tested, widely used dependency. A modern Spring Boot developer's real skill is knowing the ecosystem: which dependency solves which problem, how mature and well-maintained it is, and how to configure it correctly — not reinventing an HTTP server or a JSON parser from scratch.
When you have a problem — "I need to talk to a database," "I need to send emails," "I need real-time updates" — the first question is not "how do I write this?" but "which dependency already solves this, and is it the right fit here?"
What This Course Covers
This course walks through 30+ dependencies grouped into logical categories: web and REST APIs, WebSocket and GraphQL, data and persistence, database drivers, NoSQL and caching, messaging, security, testing, observability, and developer productivity tools. Each lesson follows the same structure: use case, the exact dependency snippet, minimal setup, and a working code example.
| Category | Example Dependencies |
|---|---|
| Web & APIs | spring-boot-starter-web, spring-boot-starter-webflux |
| Real-Time & GraphQL | spring-boot-starter-websocket, spring-boot-starter-graphql |
| Data & Persistence | spring-boot-starter-data-jpa, spring-boot-starter-jdbc |
| Database Drivers | mysql-connector-j, postgresql, h2, mssql-jdbc |
| NoSQL & Caching | spring-boot-starter-data-mongodb, spring-boot-starter-cache |
| Security & Testing | spring-boot-starter-security, spring-boot-starter-test |
Common Mistakes
- Adding dependencies you do not actually need "just in case" — every dependency increases build time, JAR size, and your attack surface.
- Copy-pasting dependency versions from random blog posts instead of letting Spring Boot's parent POM manage compatible versions for you.
- Not knowing the difference between a "starter" (a bundle of dependencies) and a single-purpose library — this course explains starters in Lesson 4.
Best Practices
- Always check whether a Spring Boot starter already exists for your use case before pulling in a raw third-party library.
- Pin dependency versions through Spring Boot's Bill of Materials (BOM) rather than hardcoding versions everywhere.
- Periodically review your dependency list and remove anything unused — leftover dependencies are a common source of confusion and security risk.
Frequently Asked Questions
Both. Lesson 3 compares declaring the same dependency in Maven's pom.xml and Gradle's build.gradle, and later lessons primarily show Maven XML snippets that translate directly to Gradle.
Basic familiarity with Spring Boot (annotations like @RestController, @Service, @Autowired) is helpful, since each lesson assumes you can read simple Spring code, but you do not need deep expertise.
Yes. Every dependency covered is open-source and available on Maven Central at no cost.
Key Takeaways
- A dependency is a compiled library, identified by groupId:artifactId:version, that your build tool downloads and adds to your classpath.
- Maven Central is the default public repository nearly all Java dependencies are published to and downloaded from.
- Modern Spring Boot development is largely about assembling well-tested dependencies rather than writing everything by hand.
- This course catalogs 30+ dependencies across web, data, messaging, security, and testing categories.
Summary
A Spring Boot application is really a careful selection of dependencies, each solving one well-defined problem, wired together with a relatively small amount of your own code. Understanding the dependency ecosystem — what exists, what it is for, and how to add it — is exactly what this course will teach you, one category at a time.
- You understand what a Maven/Gradle dependency is.
- You know what Maven Central is and how dependencies are published.
- You are ready to see why this knowledge matters in real jobs and interviews.