Configuring thin Spring Boot applications
You can thin a Spring Boot application to create efficient Docker layers and use resources efficiently.
For the most current
information about deploying Spring Boot applications to Liberty, see the Open Liberty website.
Before you begin
helloserver
server configuration with enabled Liberty features that are necessary to support
the Spring Boot application.About this task
A Spring Boot application JAR or WAR file is a self-contained artifact. It packages all of the
application dependencies inside the final artifact alongside the application content, including an
embedded server implementation, such as Tomcat, Jetty, or Undertow. The result is a fat artifact
that is easy to run on any server that has a JVM. It also results in a large artifact, even for the
smallest hello world
Spring Boot web application.
With a microservices architecture, the application content included in a Spring Boot application JAR file can be small and likely much smaller than the Spring Boot framework dependencies. A large application JAR file can become costly to deploy if your application needs frequent updates. For example, if you use Docker to deploy your application to the cloud, you need to build a new Docker layer that includes your updated application content. This new Docker layer contains the updated fat JAR file, which contains both your application content and all of the Spring Boot framework dependencies, resulting in large Docker layers for updating your application in the cloud.
Liberty can create efficient Docker layers for your application updates and use resources efficiently when you deploy frequent updates to your microservice applications in the cloud.
Liberty uses the springBootUtility command to separate the Spring Boot application content from the dependencies that are packaged inside of the Spring Boot application, thinning the Spring Boot application. For command line options, see the springBootUtility command.