It’s now easy to include Open Liberty in your Spring Boot project
It’s been a few weeks since my talk at Spring One, and I thought it might be a good time to recap and expand a bit on some of what was said (watch the presentation WebSphere on Pivotal Cloud Foundry on YouTube).
IBM was at Spring One to talk about deploying WebSphere on Pivotal Cloud. For a while, the only deployment option was the open source WebSphere Liberty buildpack on GitHub. The buildpack supports Java EE and Spring apps, packaged as EARs or WARs, deployed to Open Liberty.
We’ve recently expanded support for Spring apps with Open Liberty. Since 126.96.36.199, Spring Boot applications can be deployed directly to Liberty, Liberty can be embedded in the Spring Boot JAR, and we’ve added support for building Docker images that can be deployed to the Pivotal Container Service (PKS) or any other container service. The figure below summarizes the Spring Boot / Liberty deployment options:
Running an app server, Cloud Foundry, or Docker? Liberty meets you where you are!
We think Liberty and Spring go well together, and it makes sense to make that easy. As I said at Spring One: Liberty loves Spring! And we want to make it easy for Spring Boot developers to love Liberty.
Want to add Open Liberty to your Spring Boot app?
We want to make it easy for you to use Open Liberty with Spring Boot. To do that, we meet you where you are; specifically:
It needs to be extremely easy to include Liberty in your Spring Boot project
Adding Liberty should be a done in a familiar way
Introducing the boost-maven-plugin! The boost-maven-plugin (GitHub) is a simple plugin you add to your
pom.xml, and with a little configuration, packages Liberty inside your Spring Boot jar:
We started the boost-maven-plugin with a simple idea: make it really easy to do things you want to do. Want to add Open Liberty to your Spring Boot app? Configure the
package goal as shown below:
This embeds Open Liberty into your Spring Boot application during the package phase of your maven build. It actually runs after the Spring Boot package phase to ensure that the Spring Boot application packaging is not interrupted or altered.
Want to use Docker with your Spring Boot app? Docker is the future of deploying applications. Spring Boot applications are no exception. To make it easy and quick to get started, the boost-maven-plugin has a
docker-build goal which will build a Docker image for your app. If you don’t have a Dockerfile, it will create an opinionated Dockerfile for you. Just run the
docker-build goal or configure your plugin executions in your pom.xml:
Why Open Liberty for Spring Boot?
Spring Boot already comes with Tomcat as its default embedded servlet container. So you might wonder, why use Liberty instead?
Well, Open Liberty is small but powerful. Designed from the ground up, Liberty is a small, fast, lightweight runtime for cloud-native Java applications, and there’s some really cool technology inside:
Auto-tuning thread pool
Advanced security integrations for social login
Enterprise security solutions
Simply stated, Open Liberty is an enterprise-grade open source server runtime for Java developers.
Open Liberty embraces Spring apps
We’re updating Open Liberty to embrace Spring apps more than ever before. But why are we doing this? It comes down to this: we honestly believe that Open Liberty is the best runtime for Java applications and are always working hard to improve it.
Open Liberty was designed for virtualized environments, so it’s perfect for the cloud and containers. We also designed Liberty to be really easy to use, and we want as many people as possible to play with it. That’s why Open Liberty exists – to get people easy (and free) access to Liberty!
We are constantly exploring better ways to make Liberty more valuable to Spring developers and to contribute to the overall Spring experience. If you have ideas, create a pull request or come talk to us on gitter.im/OpenLiberty/boost.
I’m excited about what we can build together. See you at Spring One 2019 in our hometown of Austin, TX! In the meantime, please check out the video of our WebSphere on Pivotal Cloud Foundry @ Spring One 2018 talk.