

The most popular Jenkins Tomcat deployment plugin is named Deploy to container, which can be installed through the Plugin Manager tab under the "Manage Jenkins" section of the tool. That means a Jenkins Tomcat deploy plugin must be installed in the CI tool to make a deployment happen. Out of the box, there are no built-in features that perform a Jenkins WAR file deployment to Tomcat.

Step 2: Add the 'Deploy WAR/EAR to a container Jenkins' plugin

You can do this with an edit of the tomcat-users.xml file, which can be found in Tomcat's conf directory.Īfter you edit the tomcat-users.xml file, it's a good idea to bounce the Tomcat server to confirm the changes have taken effect. Step 1: Add to Tomcat a user with deployment rightsįor a successful Jenkins Tomcat deploy of a WAR file, you must add a new user to Tomcat with manager-script rights. But what we need is the patch-1 branch, which creates a WAR file that can be deployed to Tomcat by Jenkins. The master branch creates a JAR file, with Tomcat embedded within. Pay special attention to the last command, where you will switch to the patch-1 branch. If you need a web application for Jenkins to deploy to Tomcat, feel free to clone my rock-paper-scissors Java web app from GitHub:

