Skip to the workspace
Pebellslearn by building
Spring Boot Starters  ›  Lesson

What a Starter Is

Spring Boot Starters 10 minA starter is a dependency that brings a tested set of libraries for one feature, which auto-configuration then sets up.

spring boot / What a Starter Is

Explore each scene at your own pace.

01 · The rule

The rule

What a Starter Is

Before Spring Boot, adding a REST API to a project meant hunting down a dozen libraries: Spring MVC, a JSON library, a servlet container, a validation library, and a version of each that worked with all the others. One wrong version and the app failed at startup with an error nobody could explain. Starters replaced that hunt with a single line.

The rule

One starter, one feature: it brings the libraries, Boot brings the setup.

A starter is a dependency that contains almost no code of its own. Its job is to pull in a tested set of other libraries for one feature. For library-service's REST API:

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

That one entry brings Spring MVC, Jackson for JSON, an embedded Tomcat server, and logging. You write no version number and no glue code.

Starters work hand in hand with auto-configuration (the next section). The starter puts libraries on the classpath; auto-configuration notices them and creates the beans they need. So adding spring-boot-starter-web is enough for the app to start a web server on port 8080 and serve your @RestControllers.

The name tells you who made it:

  • Official starters are named spring-boot-starter-<feature>, such as spring-boot-starter-web.
  • Third-party starters put their own name first, <project>-spring-boot-starter, such as mybatis-spring-boot-starter. The spring-boot prefix is reserved for the Spring team.

The same starters work with Gradle:

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
}
Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.