本机环境已有jdk11
一、安装配置maven环境
1、下载maven
wget https://dlcdn.apache.org/maven/maven-3/3.9.3/binaries/apache-maven-3.9.3-bin.tar.gz
2、解压
tar -zxvf apache-maven-3.9.3-bin.tar.gz
3、移动位置
mv apache-maven-3.9.3 /usr/local/
4、加入环境变量
在/etc/profile文件最下方加入新的一行
export PATH=$PATH:/usr/local/apache-maven-3.9.3/bin
添加完成之后,执行
source /etc/profile
让配置生效
5、验证
执行
which mvn
显示/usr/local/apache-maven-3.9.3/bin/mvn说明配置成功了
二、安装git环境
1、安装
执行
yum -y install git
2、验证
git --version
显示git version 1.8.3.1则安装成功
三、jenkins 1、下载jenkins
wget https://mirrors.aliyun.com/jenkins/war-stable/2.361.1/jenkins.war
2、启动
nohup java -jar /opt/jenkins/jenkins.war --httpPort=9090 &
3、设置开机启动
echo 'java -jar /opt/jenkins/jenkins.war --httpPort=9090' >> /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local
4、如果报错就补充插件
yum install fontconfig
配置maven
setting_all.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>uk</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://uk.maven.org/maven2/</url>
</mirror>
<mirror>
<id>CN</id>
<name>OSChina Central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>nexus</id>
<name>internal nexus repository</name>
<url>http://repo.maven.apache.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
</settings>
未完待续。。。2023年6月28日 10:16:56