Spring Boot programming model support

Liberty supports the Spring Boot application programming model to develop Spring applications.

Background

Spring Boot is designed to get you up and running as quickly as possible. For more information, see the Spring Boot project site.

A typical Spring Boot application is a stand-alone JAR file that can run without deployment to an application server. This stand-alone file can simplify the development of Spring Boot applications. However, when you deploy the application to a production environment, you do not have the benefits of an application server.

The Spring Boot application JAR file format is a supported application type in Liberty. You can deploy Spring Boot applications to Liberty without packaging them as a WAR file. Liberty provides tools for optimizing the deployment of Spring Boot applications to containers, such as Docker.

Attention: Liberty support for Spring Boot is integrated with support for the web container by using the servlet-4.0 and jsp-2.3 features. The transportSecurity-1.0 or websocket-1.1 features can be enabled if HTTPS or WebSocket support is needed. All other server configuration is handled by Spring Boot application properties.

For example, security properties can be set by using spring.security.* application properties. The Liberty Spring Boot features, springBoot-1.5 and springBoot-2.0, do not integrate with the functions that are provided by other Liberty features, such as appSecurity-2.0 and jaxrs-2.1. If an application needs functions similar to what is provided by these Liberty features, the Spring Boot project provides Spring Boot starters that can be included in the application. Including Spring Boot starters like spring-boot-starter-security or third-party starters like cxf-spring-boot-starter-jaxrs in an application allows it to use technologies that are provided by the starter instead of using Liberty features.

Spring Boot starters

Table 1. Spring Boot support
Spring Boot starter Liberty feature Liberty Liberty Core
Spring Boot 1.5
spring-boot-starter springBoot-1.5
spring-boot-starter-web springBoot-1.5 and servlet-3.1, servlet-4.0, or jsp-2.3
spring-boot-starter-websocket springBoot-1.5 and websocket-1.0 or websocket-1.1
Spring Boot 2.0
spring-boot-starter springBoot-2.0
spring-boot-starter-web springBoot-2.0 and servlet-3.1, servlet-4.0, or jsp-2.3
spring-boot-starter-websocket springBoot-2.0 and websocket-1.0 or websocket-1.1
spring-boot-starter-webflux springBoot-2.0 and servlet-3.1, servlet-4.0, or jsp-2.3

In addition to the starters that are listed, other Spring Boot starters are available for Spring Boot applications. More starters that are included in the application do not require you to enable more Liberty features.