Skip to main content

Spring Initializr

Head to Spring Initializr, the official Spring Boot project generator (honorable mention to Bootify, interesting alternative).

You’ll see a form, don’t panic—we’ll decode each option.

spring initializr

Project: Maven vs Gradle

🔍 Click to zoom

Spring Boot Versions

When selecting a Spring Boot version, you’ll encounter three types of labels:

  • SNAPSHOT
    • Indicates a development build of Spring Boot.
    • These versions are unstable, actively being worked on, and may include untested features or bugs.
    • Avoid using them for production, as they can change without notice.
  • M1, M2, etc. (Milestones)
    • Pre-release versions mark major milestones (e.g., new features) before a stable release.
    • More stable than SNAPSHOT but still not production-ready. Ideal for early testing of upcoming features.
  • No Marker (Stable Releases)
    • These are stable releases, rigorously tested and production-ready.

Always opt for the highest stable version (without SNAPSHOT/M labels) unless you explicitly need experimental features.

Project Metadata

The Project Metadata section defines your project’s identity and structure. Here’s a breakdown of each field and its recommended conventions:

FieldWhat It MeansRecommended Structure/StandardExample
GroupIdentifies your organization/teamUse reverse domain name notation. Avoid generic termscom.acme
ArtifactThe project’s nameUse lowercase letters and hyphens for multi-word namesinventory-service
NameHuman-readable display nameUse spaces/capitalization for readabilityInventory Management
DescriptionBrief summary of the project’s purpose. Added to pom.xml/build.gradleKeep concise (1–2 sentences) and specificMicroservice for tracking warehouse inventory
Package NameRoot Java package for source codeDerived from Group + Artifact (hyphens removed)com.acme.inventoryservice

Personal preference: I like to use underscore (_) in the artifact name. There’s no rule against it, it's just not common. But I feel it helps to keep consistency, cause Spring Initializr will replace the hyphen with underscore in some folders.

Packaging: JAR vs WAR

Packaging determines how your application is bundled into a single, shareable file, enabling it to run smoothly on any system without complex setup.

FormatBest ForKey Difference
JARModern Spring Boot apps, microservices, cloud deploymentsContains embedded server (e.g., Tomcat) for self-contained execution
WARLegacy apps or deployments to external servers (e.g., traditional Tomcat, JBoss)Requires a separate server to run; no embedded server included

Use JAR unless you’re bound to legacy infrastructure. JAR is the default in Spring Boot. Spring Boot’s embedded server makes JAR the lightweight, hassle-free choice for most projects today.

Java Version

  • Stick with what your team uses.
    • If your team is using an old unsupported version, go for the lowest version Spring Initializr provides.
  • If unsure, pick the latest LTS—it’s the sweet spot.

Dependencies

Dependencies are pre-built libraries that add specific features to your app (like tools in a toolbox). For now, we’ll use the ones you’ll need in 90% of real-world Spring projects:

DependencyCategoryWhy You Need It
LombokDeveloper ToolsReduces repetitive code (e.g., getters/setters) with simple annotations
Spring Boot ActuatorOperations/MonitoringAdds health checks, metrics, and management endpoints for your app
Spring Boot DevToolsDeveloper ToolsSpeeds up development with auto-restarts, LiveReload, and debug-friendly config
Spring Configuration ProcessorDeveloper ToolsEnables code-completion for custom application.properties/yml settings
Spring WebWebBuild REST APIs with Spring MVC + embedded Tomcat server

Generate

Once you’ve configured your Spring Boot app, hit the Generate button (or Ctrl + Enter). Spring Initializr will bundle your project into a .zip file.

In this screenshot down below, I’m creating the Users Manager application that we will develop during the rest of this guide.

generating project

What’s inside the zip?

  • A standard project structure (folders for code, tests, configs).
  • Preconfigured pom.xml (Maven) or build.gradle (Gradle).
  • A starter application.properties file.
  • The main class (*Application.java) to run your app.

Don’t worry about the details yet – we’ll unpack and explore everything together in the next steps!