In this tutorial we are going to discuss how to configure Maven in Jenkins machine.
a) Install Maven manually on Jenkins VM
Run below commands
cd /opt/
wget https://mirrors.estointernet.in/apache/maven/maven-3/3.8.1/binaries/apache-maven-3.8.1-bin.tar.gz
tar -zxvf apache-maven-3.8.1-bin.tar.gz
Now maven will be unpacked to /opt/apache-maven-3.8.1
Login to Jenkins > Go to Manage Jenkins > Global Tools Configuration
Click on Maven Installation under Maven
b) Install Maven from Jenkins Console
Login to Jenkins > Click on Manage Jenkins ( Left side )
Click on Global Tool Configurations
Click on Maven Installation under Maven
Click on Save
With this steps we have maven is integrated in your Jenkins. You can start using maven for build automation of the product.