Skip to content

Latest commit

 

History

History
52 lines (43 loc) · 2.01 KB

maven_installation.md

File metadata and controls

52 lines (43 loc) · 2.01 KB

Install & configure Maven build tool on Jenkins

Maven is a code build tool which used to convert your code to artifact. this is widely used plugin to build in continuous integration

Follow this artical in YouTube

Prerequisites

  1. Jenkins server **Get Help Here

Install Maven on Jenkins

Download maven packages https://maven.apache.org/download.cgi onto Jenkins server. In this case I am using /opt/maven as my installation directory - Link : https://maven.apache.org/download.cgi

  # Creating maven directory under /opt
  mkdir /opt/maven
  cd /opt/maven
  # downloading maven version 3.6.0
  wget http://mirrors.fibergrid.in/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.zip
  unzip /opt/maven/apache-maven-3.6.0-bin.zip

Setup M2_HOME and M2 paths in .bash_profile of user and add these to path variable

  vi ~/.bash_profile
  M2_HOME=/opt/maven/apache-maven-3.6.0
  M2=$M2_HOME/bin
  PAHT=<Existing_PATH>:$M2_HOME:$M2

Check point

logoff and login to check maven version Check maven version

  mvn –version

So far you have completed installation of maven software to support maven plugin on jenkins console. Let's jump onto jenkins to complete remining steps.

Setup maven on jenkins console

  • Install maven plugin without restart
    • Manage Jenkins > Jenkins Plugins > available > Maven Invoker

(Update) Install "Maven Integration" Plugin as well

  • Install maven Integration Plugin without restart

    • Manage Jenkins > Jenkins Plugins > available > Maven Integration
  • Configure java path

    • Manage Jenkins > Global Tool Configuration > Maven

Next Steps