Setting up Maven in Jenkins: A Comprehensive Tutorial

  What is Maven?                                   The Maven is one of the build tools, which is used in the CICD pipeline to build the pack...


What is Maven?

                            The Maven is one of the build tools, which is used in the CICD pipeline to build the package like a jar, war.. etc

To install the maven locally we need to download the source code package from the Apache official website

Apache Official URL:

To download the Maven package from the Apache website use the below command on the linux machine

Command: wget

I am downloading maven 3.8.6 you can download the latest Maven version using the above Apache official url

Untar the downloaded file and move the name as maven and mv the directory into the /opt directory.


tar -xvf apache-maven-3.8.6-bin.tar.gz

mv apache-maven-3.8.6  /opt/

mv apache-maven-3.8.6   maven

Once maven is placed in the /opt we need to set the maven path in env.variables for that we need to edit the .bash_profile file and add the below lines.



Path add the $M2_HOME:$M2

After the update we need to verify whether the env.variables are set or not, to verify using the below command.

source ~/.bash_profile
echo $PATH

Checking the maven version by running the below command

Command: mvn --version 

Now successfully maven installed, we need to setup the maven path in the Jenkins

To set up Maven click manage Jenkins → Global Tool configuration and scroll down until the Maven installations step.

Click add Maven → For the name need to give them as maven and maven_home path also need to give the home path /opt/maven → click apply and save.

Now all setup is completed, we can create the new maven project with SCM and check

Log in to Jenkins and create a new job by clicking the option new item and create the maven build job
Create the new job log in the Jenkins -- > create the job --> give the name of the job --> click maven project

In the Configuration of git, you need to give the maven project, I had a repo in my GitHub account.

Save and run the Jenkins job and see the logs
The Maven project successfully created and ran it successfully.

----------------------------------------!!!! Happy Learning with Techiev !!!!!!!!---------------------------------

-------------------------Subscribe our Youtube Channel by clicking the below link---------------------- ----------------------------!!!!---------------------




Techie View: Setting up Maven in Jenkins: A Comprehensive Tutorial
Setting up Maven in Jenkins: A Comprehensive Tutorial
Techie View
Loaded All Posts Not found any posts VIEW ALL View Full Article Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy