1.1.1 安装Maven插件
我们要使用Jenkins+Maven对Java项目进行构建,需要安装Maven Project Plugin,具体安装过程请参考插件管理部分
1.1.2 3、Linux下安装Maven
1)下载Maven 3安装包
官网:http://maven.apache.org/download.cgi
清华镜像:https://mirrors.tuna.tsinghua.edu.cn/apache/maven/
2)安装Maven
[root@node3 src]# wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
[root@node3 src]# tar xf apache-maven-3.3.9-bin.tar.gz
[root@node3 src]# mv apache-maven-3.3.9 /usr/local/
[root@node3 src]# ln -s /usr/local/apache-maven-3.3.9/ /usr/local/maven
[root@node3 src]# cd ..
[root@node3 local]# /usr/local/maven/bin/mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /usr/local/maven
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_121/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-693.5.2.el7.x86_64", arch: "amd64", family: "unix"
3)配置
编辑/etc/profile文件,在末尾添加export PATH=/usr/local/apache-maven-3.3.9/bin/:$PATH
Jenkins
Maven 插件配置