How to install maven in the Jenkins linux machine? how to setup MAVEN in jenkins? Creating the Maven project

  What is Maven ?                                   The Maven is a one of the build tool, which is used in the CICD pipeline to build the pa...


 

What is Maven ?

                            The Maven is a one of the build tool, which is used in the CICD pipeline to build the package as 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:  https://maven.apache.org/download.cgi

To download the maven package from the apache website use the below command in the linux machine

Command: wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz

I am downloading the 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.

Commands:

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 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.

M2_HOME=/opt/maven

M2=/opt/maven/bin

Path add the $M2_HOME:$M2



After update we need to verify whether the env.varribales 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 scroll down until the maven installations step.


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

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

Log in to the Jenkins and create a new job by clicking the option new item and create the maven build job
Create the new job login 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 repo in my GitHub account.

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


-----------------------------------------------------!!!!! KEEP LEARNING !!!!!------------------------------------------------------------














 










 

COMMENTS

Name

AWS,7,Devops,17,linux,10,
ltr
item
Techie View: How to install maven in the Jenkins linux machine? how to setup MAVEN in jenkins? Creating the Maven project
How to install maven in the Jenkins linux machine? how to setup MAVEN in jenkins? Creating the Maven project
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ_VoN1g4Sg7s25nQJjwDfI9IpGP0F4_IHmC3fRR6EJoeoowKikShNxFIj3Fjyy-qw4G6XdfaAO0uxxsEDQRGcMfl7mtK3HXYgi_e9mZ0yWZ8zZsoaTRwDhkaaYjrypO86CB0HddkSNyc0h00WK4uaLRROtUyiykhGVCdSQQ77H3-4y8qHPuE52QnqBw/w400-h115/1_M7gYkSDwC5ny9SxxBwzozA.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ_VoN1g4Sg7s25nQJjwDfI9IpGP0F4_IHmC3fRR6EJoeoowKikShNxFIj3Fjyy-qw4G6XdfaAO0uxxsEDQRGcMfl7mtK3HXYgi_e9mZ0yWZ8zZsoaTRwDhkaaYjrypO86CB0HddkSNyc0h00WK4uaLRROtUyiykhGVCdSQQ77H3-4y8qHPuE52QnqBw/s72-w400-c-h115/1_M7gYkSDwC5ny9SxxBwzozA.png
Techie View
https://www.techiev.com/2022/07/how-to-install-maven-in-jenkins-linux.html
https://www.techiev.com/
https://www.techiev.com/
https://www.techiev.com/2022/07/how-to-install-maven-in-jenkins-linux.html
true
7013663511659419322
UTF-8
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