1、Git设置
1、上传文件
将git压缩包上传到服务器上

2、解压压缩包
tar -zxvf git-2.33.0.tar.gz
3、安装所需依赖
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
【输入 y 】
【报错】
执行"安装所需依赖"的命令时,报错!报错信息如下:

【解决方案】
更改一下目录中文件,其实是更改yum的配置源 网址。
4、编译
进入解压后的目录,执行make命令。
make prefix=/usr/local/git all
5、安装
make prefix=/usr/local/git install
6、修改环境变量
#打开配置文件
vim /etc/profile
(将下面一行的代码,复制粘贴到上面的配置文件里)
#set git
export PATH=$PATH:/usr/local/git/bin
#加载一下配置文件
source /etc/profile

7、检查git
git --version
8、在Jenkins添加git配置
【第一步:】

【第二步:】

【第三步:设置git账号和密码 admin & 123456】

【第四步:设置完成】

【第五步:】

【第六步:自动帮忙生成id】

2、maven配置
1、安装
1、上传压缩包

2、解压
tar -zxvf apache-maven-3.3.9-bin.tar.gz
3、配置环境变量
#第一个命令,编辑/etc/profile
vim /etc/profile
#set maven
MAVEN_HOME=/usr/local/maven/apache-maven-3.3.9
PATH={MAVEN_HOME}/bin:{PATH}
export PATH
4、加载环境变量
source /etc/profile
5、测试maven安装是否成功
mvn -v
6、替换maven源
#打开setting文件,修改中央仓库为阿里的,不然速度太慢
vim /usr/local/maven/apache-maven-3.3.9/conf/settings.xml
找到<mirrors></mirrors>标签对,添加以下内容
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/\</url>
<mirrorOf>central</mirrorOf>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</mirror>
指定下载源位置
<localRepository>/usr/local/maven/apache-maven-3.3.9/repository</localRepository>
【注意:需要自己创建/usr/local/maven/apache-maven-3.3.9/repository目录】
2、Jenkins配置Maven
【第一步:】

【第二步:】

【第三步:点击三下Add】

【第四步:配置环境变量】
配置3个环境变量:JAVA_HOME、MAVEN_HOME
PATH+EXTRA $MAVEN_HOME/bin
