You may install a maven plugin and make the build using a maven file in Jenkins on the server using the source code of Maven basically used for java projects. we need to make sure Jenkins server communicating with your application server.
Login to Jenkins server and click on Manage Jenkins & Click on Global Tool Configuration
When you create a job for your project to make a build using Jenkins and deploy them on the server. you can also reduce manual effort by using maven plugins to make a build for your application.
This process helps you to make build and also get an email about the error where your code does not work.
How To Install Maven In Jenkins Using Plugin:
We also use the QA server before deploying the build on the production server where all the functionality will be performed and checked.
Now Click on Maven where you will choose the version of Maven I have choose Maven 3.5.4 & click on "Apply".
Now click on “New items” and choose the “Freestyle project”.
As you can see I’m able to see Maven 3.5.4 installed in Jenkins.
YouTube Link: Install Maven
You’re done so jenkins file for maven