This article will show you how to setup your Spring Boot project, so you can deploy it to Openshift.


First we need to make sure that the application extends from the SpringBootServletInitializer class.
This makes sure Openshift is able to detect and run the application. We also need to override the configure method.

public class ExampleApplication extends SpringBootServletInitializer {  
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(ExampleApplication.class);
    public static void main(String[] args) {, args);

The next step is to place the following property in your pom file (openshift doesn't yet support the spring boot default tomcat8) and add the tomcat dependency.


The last step is to make sure that maven generates a war instead of a jar file


Everything is now setup for deploying the spring boot application to openshift!

Author image
Tom Buyse
My name is Tom Buyse. I work for Bewire in Belgium. My primary focus is front-end development, which currently mostly involves Angular, Angular 2 and Ionic.
comments powered by Disqus