Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/spring-projects/spring-boot/llms.txt

Use this file to discover all available pages before exploring further.

Spring Boot works with any build system that can consume artifacts from the Maven Central repository, but Maven and Gradle are the two officially supported options. This page covers everything you need to go from zero to a working build configuration: system requirements, project generation with Spring Initializr, Maven and Gradle setup, and the optional Spring Boot CLI.

System requirements

Java

Java 17 or later. Spring Boot 3.x requires a minimum of Java 17 and is compatible through Java 25.

Maven

Apache Maven 3.6.3 or later. Maven 3.9.x is recommended.

Gradle

Gradle 7.5 or later. Gradle 8.x is recommended.
Verify your Java installation before continuing:
$ java -version
openjdk version "17.0.18" 2026-01-20 LTS
OpenJDK Runtime Environment (build 17.0.18+10-LTS)
OpenJDK 64-Bit Server VM (build 17.0.18+10-LTS, mixed mode, sharing)
Spring Boot 3.x does not support Java 8 or Java 11. If you are on an older JDK, you must upgrade before proceeding.

Spring Initializr

The fastest way to create a Spring Boot project is start.spring.io. The Initializr generates a complete project archive with your chosen build system, language, Spring Boot version, and dependencies pre-configured.
  1. Open start.spring.io in a browser.
  2. Choose Maven or Gradle as your build system.
  3. Set Group, Artifact, and Name for your project.
  4. Select Java 17 (or later) as the Java version.
  5. Add dependencies — for a web application, search for and add Spring Web.
  6. Click Generate to download the project archive.
  7. Unzip the archive and open it in your IDE.
Most modern Java IDEs include a built-in Initializr integration. In IntelliJ IDEA, use File → New → Project → Spring Boot. In VS Code, install the Spring Boot Extension Pack and use the Spring Initializr command.

Maven setup

Parent POM

Most Spring Boot Maven projects inherit from spring-boot-starter-parent. This special POM configures sensible defaults for the Maven compiler, resource filtering, and the spring-boot-maven-plugin. It also provides a <dependencyManagement> section so that you can declare Spring Boot managed dependencies without specifying version numbers.
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
             https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.5.0</version>
    </parent>
    <groupId>com.example</groupId>
    <artifactId>myproject</artifactId>
    <version>0.0.1-SNAPSHOT</version>

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

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
Notice that spring-boot-starter-webmvc has no <version> tag. The parent POM’s dependency management provides the correct, tested version for the Spring Boot release you declared.

Using spring-boot-dependencies without the parent POM

If you cannot use spring-boot-starter-parent (for example, because your project already inherits from a corporate parent POM), you can still benefit from Spring Boot’s dependency management by importing the spring-boot-dependencies BOM in your <dependencyManagement> section:
pom.xml
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>3.5.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Maven plugin

The spring-boot-maven-plugin adds a run goal for local development and a repackage goal that creates an executable jar during mvn package:
# Run the application
$ mvn spring-boot:run

# Build an executable jar
$ mvn package
$ java -jar target/myproject-0.0.1-SNAPSHOT.jar

Gradle setup

Plugins

A Spring Boot Gradle project requires two plugins:
  • org.springframework.boot — Provides the bootRun and bootJar tasks.
  • io.spring.dependency-management — Manages dependency versions, equivalent to the parent POM’s <dependencyManagement>.
build.gradle
plugins {
    id 'java'
    id 'org.springframework.boot' version '3.5.0'
    id 'io.spring.dependency-management' version '1.1.7'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-webmvc'
}

Gradle tasks

# Run the application in development mode
$ gradle bootRun

# Build an executable jar
$ gradle bootJar
$ java -jar build/libs/myproject-0.0.1-SNAPSHOT.jar

Starters

Starters are a set of convenient dependency descriptors that you can include in your application. Each starter bundles the dependencies you are likely to need for a particular type of work, with managed transitive dependencies that are tested together. All official starters follow the naming pattern spring-boot-starter-*. For example:
pom.xml
<dependencies>
    <!-- Web applications with Spring MVC and embedded Tomcat -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-webmvc</artifactId>
    </dependency>

    <!-- JPA database access with Hibernate -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

    <!-- Production-ready health checks and metrics -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
</dependencies>
Third-party starters should not use the spring-boot-starter- prefix, which is reserved for official Spring Boot artifacts. A third-party starter for a project called thirdpartyproject would typically be named thirdpartyproject-spring-boot-starter.

Spring Boot CLI

The Spring Boot CLI is an optional command-line tool that lets you quickly prototype applications using Groovy scripts. The CLI resolves @Grab dependencies automatically and runs Spring scripts without a full Maven or Gradle project structure.

Install with SDKMAN!

SDKMAN! is the recommended way to install and manage multiple versions of the CLI:
$ sdk install springboot
$ spring --version
Spring CLI v3.5.0

Install with Homebrew (macOS)

$ brew tap spring-io/tap
$ brew install spring-boot
$ spring --version
Spring CLI v3.5.0

Verify the installation

$ spring --version
Spring CLI v3.5.0

Choosing a build system

Maven

Recommended for teams already familiar with Maven’s POM model. The spring-boot-starter-parent provides a complete, opinionated configuration out of the box.

Gradle

Recommended for projects that need faster incremental builds, Kotlin DSL support, or more flexible build logic. The Spring Boot Gradle plugin provides equivalent functionality to the Maven plugin.
It is possible to use Spring Boot with other build systems such as Apache Ant with the spring-boot-antlib AntLib module, but Maven and Gradle are the only officially supported options.

What’s next

Quickstart

Build and run your first Spring Boot application step by step.

Introduction

Learn about auto-configuration, embedded servers, Actuator, and native images.

Build docs developers (and LLMs) love