Логотип Workflow

Article

Starters And Dependency Management

Module 4. Starters and BOM: How to Avoid Dependency Chaos

Module goal

Learn to build Spring Boot projects without dependency conflicts and version drift.

What we cover

  • What a starter is and why it exists.
  • How BOM-based dependency management works.
  • How to inspect and control dependency trees.

Step 1. What is a starter

A starter is a curated dependency bundle for a specific scenario.

Examples:

  • spring-boot-starter-web
  • spring-boot-starter-data-jpa
  • spring-boot-starter-security
  • spring-boot-starter-test

Step 2. Why starter-based setup is better

  • Less manual work.
  • Compatible versions out of the box.
  • Lower runtime conflict risk.

Step 3. Practice: baseline Gradle setup

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter-validation'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    runtimeOnly 'org.postgresql:postgresql'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

Step 4. What Spring Boot BOM does

BOM defines compatible versions for transitive dependencies. In most cases, you should not hardcode versions for Boot-managed artifacts.

Step 5. Dependency tree inspection

Run periodically:

./gradlew dependencies

and inspect actual resolved versions.

Common mistakes

  • Adding many starters "just in case".
  • Explicitly pinning versions already managed by BOM.
  • Keeping unused dependencies.

Mini homework

  1. Build a minimal REST + JPA + PostgreSQL app.
  2. Inspect dependency tree and list 5 key libraries.
  3. Remove one unnecessary dependency and confirm behavior still works.

Checklist

  • I understand starter vs regular library.
  • I understand why BOM exists.
  • I can read and reason about dependency trees.

Quiz

Check what you learned

Please login to pass quizzes.