发布时间:2023-07-10 18:00
搜索插件 Maven Integration
检验插件是否已安装
apache-maven-3.6.3-bin.tar.gz
解压到Jenkins挂载目录位置 [ /usr/local ]
配置settings.xml
nexus-aliyun
*
Nexus aliyun
http://maven.aliyun.com/nexus/content/groups/public
添加环境变量
[root@centos-7 local]# vi /etc/profile
在最后加上以下内容:
export M2_HOME=/usr/local/apache-maven-3.6.3
export PATH=$PATH:${M2_HOME}/bin
保存并退出编辑,使用下面的命令让修改生效
[root@centos-7 local]# vi /etc/profile
验证Maven安装
[root@centos-7 local]# mvn -version
启动Jenkins镜像命令需要挂载maven目录:
docker run -d --restart=always -p 8080:8080 -p 50000:50000 --name jenkins -v /usr/local/jenkins/jenkins_home:/var/jenkins_home -v /usr/local/apache-maven-3.6.3:/usr/local/maven jenkins/jenkins:lts
/var/jenkins_home/apache-maven-3.6.3/conf/settings.xml