Spring Boot – Simplifying Spring for Everyone

We are pleased to announce the first milestone release of a new project called Spring Boot.

Spring Boot aims to make it easy to create Spring-powered, production-grade applications and services with minimum fuss. It takes an opinionated view of the Spring platform so that new and existing users can quickly get to the bits they need. You can use it to create stand-alone Java applications that can be started using ‘java -jar’ or more traditional WAR deployments. We also provide a command line tool that runs ‘spring scripts’.

The diagram below shows Spring Boot as a point of focus on the larger Spring ecosystem. It presents a small surface area for users to approach and extract value from the rest of Spring:

The primary goals of Spring Boot are:

To provide a radically faster and widely accessible ‘getting started’ experience for all Spring development

To be opinionated out of the box, but get out of the way quickly as requirements start to diverge from the defaults

To provide a range of non-functional features that are common to large classes of projects (e.g. embedded servers, security, metrics, health checks, externalized configuration)

Spring Boot does not generate code and there is absolutely no requirement for XML configuration.

Spring Scripts

Spring Boot ships with a small command line application that can be used to run ‘spring scripts’. Spring scripts are written in Groovy, which means that you have a familiar Java-like syntax, without so much boilerplate code. We are able to deduce a lot of information simply by looking at the way you have written your script. For example, here is a simple web application:

Other than import statements, the main difference between this example and the earlier Groovy script is the main() method that calls SpringApplication and the @EnableAutoConfiguration annotation.

Obviously with Java you also need a build system to compile and package your code. We provide a number of convenient ‘starter’ POMs that you can use with Maven, Gradle or Ant+Ivy to quickly grab appropriate dependencies. For example, the application above would need just a single dependency to the spring-boot-starter-web module.

We also provide Maven and Gradle plugins that allow you to package a fully self contained 'fat jar' that can be started from the command line:

Production Ready

Spring Boot also includes helpful features that you often need when you push an application into production. We can automatically provide web endpoints that you can use to monitor application health, provide basic metrics or use to analyze production issues (such as thread deadlocks). We also provide a new @ConfigurationProperties annotation that you can use to externalize your application configuration (complete with support for JSR-303 @Valid annotations).

SpringOne 2GX 2013 is around the corner

Book your place at SpringOne in Santa Clara soon. It’s simply the best opportunity to find out first hand all that’s going on and to provide direct feedback. Expect a number of significant new announcements this year. Check recent blog posts to see what I mean and there is more to come!