jenkins部署tomcat
maven编译环境(jenkins服务器)
运行环境(web服务器)
一、部署maven编译环境(jenkins)
Maven是一个Java项目管理和构建工具,它可以定义项目结构、项目依赖,并使用统一的方式进行自动化构建,是Java项目不可缺少的工具。
1、jenkins部署maven软件
1)下载安装包
[root@jenkins ~]# cd /opt/
[root@jenkins /opt]# wget https://mirrors.aliyun.com/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
2)解压
[root@jenkins /opt]# tar -xf apache-maven-3.6.3-bin.tar.gz -C /usr/local/
3)配置环境变量
[root@jenkins /opt]# vim /etc/profile.d/maven.sh
export MAVEN_HOME=/usr/local/apache-maven-3.6.3
export PATH=$MAVEN_HOME/bin:$PATH
# 刷新
[root@localhost opt]# source /etc/profile
4)安装JDK
[root@jenkins /opt]# yum install java-1.8.0-openjdk* -y
5)检查
[root@jenkins /opt]# mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/apache-maven-3.6.3
Java version: 1.8.0_282, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1160.el7.x86_64", arch: "amd64", family: "unix"
2、配置jenkins + maven
1)配置JDK