Create Jenkins Production Job For Maven Project 

In our previous articles, we have already created job for maven project using pipelines. we’ve not deploy the code on the production server yet. So, today we will create Jenkins production job for maven.

Step 1 : I’m supposing you’re aware of how to create maven job for your project if not you can visit our this article.

Check Out : Create a Job For Maven Project(Java) In Jenkins Server

First of all, you need a plugin installed for deploy the war files directly on tomcat server. You must have install maven plugins before starting the work.

Go to Manage plugins -> choose available -> and Look for deploy to container plugin and install it.

After successfully, installation of plugins and you need to ask few thins from developers which i will mentioned below with screenshot.

Step 2 : Click on Item -> Maven project and Ok

Click on Discard old build,

Check Out : How To Create Pipeline For Maven Project In Jenkins

Step 3 : Click on Source code Management, if you’re using git then select it.

You need to put the git repository url that ends with .git and master branch name. you’ll get these information from developers.

Step 4 : Next you can choose build trigger

Choose build, here you need to define commands to make war file and pom.xml can be on different path.

Step 5 : In the post steps, choose run only if build succeeds.

You can also send en email notification by using the E-mail notifications.

Check Out : How To Solve Missing Jenkins Login Page

Step 6 : Finally here you need to define the tomcat server ip address, port and credentials to run tomcat server.

Go to post-build actions and choose deploy war/ear to a container, and here i’m just giving you an example the location of war/ear files and context path need to ask from developers.

You also need to add tomcat url credentials,

After these all settings, you need to run the build and see this should work.

You’re done.


Please enter your comment!
Please enter your name here

three × 1 =