Skip to content

Commit e213d9a

Browse files
authored
Create maven_installation.md
1 parent 6b08093 commit e213d9a

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

maven/maven_installation.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Install & configure Maven build tool on Jenkins
2+
Maven is a code build tool which used to convert your code to artifact. this is widely used plugin to build in continuous integration
3+
4+
#### Follow this artical in **[YouTube](https://www.youtube.com/watch?v=wgfsVmHnAiM)**
5+
6+
#### Prerequisites
7+
1. Jenkins server **[Get Help Here](https://www.youtube.com/watch?v=M32O4Yv0ANc)
8+
9+
#### Install Maven on Jenkins
10+
Download maven packages https://maven.apache.org/download.cgi onto Jenkins server. In this case I am using /opt/maven as my installation directory
11+
- Link : https://maven.apache.org/download.cgi
12+
```sh
13+
# Creating maven directory under /opt
14+
mkdir /opt/maven
15+
cd /opt/maven
16+
# downloading maven version 3.6.0
17+
wget http://mirrors.fibergrid.in/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.zip
18+
unzip /opt/maven/apache-maven-3.6.0-bin.zip
19+
```
20+
21+
Setup M2_HOME and M2 paths in .bash_profile of user and add these to path variable
22+
```sh
23+
vi ~/.bash_profile
24+
M2_HOME=/opt/maven/apache-maven-3.6.0
25+
M2=$M2_HOME/bin
26+
PAHT=<Existing_PATH>:$M2_HOME:$M2
27+
```
28+
#### Check point
29+
logoff and login to check maven version
30+
Check maven version
31+
```sh
32+
mvn –version
33+
```
34+
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.
35+
36+
#### Setup maven on jenkins console
37+
- Install maven plugin without restart
38+
- `Manage Jenkins` > `Jenkins Plugins` > `available` > `Maven Invoker`
39+
40+
#### (Update) Install "Maven Integration" Plugin as well
41+
- Install maven Integration Plugin without restart
42+
- `Manage Jenkins` > `Jenkins Plugins` > `available` > `Maven Integration`
43+
44+
- Configure java path
45+
- `Manage Jenkins` > `Global Tool Configuration` > `Maven`
46+
47+
#### Next Steps
48+
49+
- [x] [Configure Users & Groups in Jenkins](https://youtu.be/jZOqcB32dYM)
50+
- [x] [Secure your Jenkins Server](https://youtu.be/19FmJumnkDc)
51+
- [x] [Jenkins Plugin Installation](https://youtu.be/p_PqPBbjaZ4)
52+
- [x] [Jenkins Master-Slave Configuration](https://youtu.be/hwrYURP4O2k)

0 commit comments

Comments
 (0)