Openshift WildFly War Deployment

Openshift helps people for an open source cloud application platform. Openshift enables polyglot applications to be deployed on a public,private, and a hybrid cloud easily. This provides an extensible cartridge-based architecture which allows a wide range of functionality such as frameworks, databases, monitoring services. WildFly cartridge allows people to start a wildfly instance in openshift.

Openshift provides S2I enabled wildfly images to build and run java applications. The image merges the source of the application with the required dependencies for creating a new image which contains a java application. This resulting image can be run either openshift or by docker.

In this article, how to create war file from a spring boot project and how to deploy that war file on openshift will be shown. At the beginning, tomcat must be pulled out because wildfly will be used. To eject tomcat, some codes must be added to the pom file as follows.

To get rid of tomcat

Packaging tag has also to be altered as war.

To get rid of tomcat

To create war file, following codes must be written in the pom file.

To get rid of tomcat

After all this handled, open maven project section, choose clean and package part then click the run button.

To get rid of tomcat

When maven build is finished, open project file and find warfile. Upload that file in the github. Finally, in openshift web console, click wildfly.

To get rid of tomcat
To get rid of tomcat

Fill in the blanks, then click create. In git repository path, give the address of the application in the github. That is it. The application is ready.

To get rid of tomcat

As can be seen, route are ready, so click route.

To get rid of tomcat