jenkins相关配置

全局工具配置

1.配置JDK

在这里插入图片描述

2.配置Git

如果对版本没有特殊要求可以执行下面的命令:

yum -y install git

yum安装git被安装在/usr/libexec/git-core目录下
在这里插入图片描述

3.配置maven

一. 下载压缩包:

官网地址: http://maven.apache.org/download.cgi

二. 上传到linux的/usr/local目录

cd /usr/local

可以使用rz目录上传

三. 解压文件

tar -zxvf apache-maven-3.8.1-bin.tar.gz

四. 配置环境变量

vi /etc/profile
export MAVEN_HOME=/usr/local/apache-maven-3.8.1
export PATH=$MAVEN_HOME/bin:$PATH 

五. 刷新环境变量

source /etc/profile

六. 检查版本

mvn -v

在这里插入图片描述
修改maven仓储源

文件路径:/usr/local/apache-maven-3.8.1/conf/settings.xml

<settings>
 <mirrors>
	 	 <mirror>
	        <id>ali-repo</id>
            <mirrorOf>central</mirrorOf>
            <name>Aliyun Mirror.</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        </mirror>
 </mirrors>
 <localRepository>/usr/local/repository</localRepository> <!--本地存放地址-->
 <profiles>
	 <profile>
		 <id>nexus</id>
		
		 <repositories>
			 <repository>
				 <id>central</id>
				 <url>http://central</url>
				 <releases><enabled>true</enabled></releases>
			 	 <snapshots><enabled>true</enabled></snapshots>
			 </repository>
		 </repositories>
		 <pluginRepositories>
			 <pluginRepository>
				 <id>central</id>
				 <url>http://central</url>
				 <releases><enabled>true</enabled></releases>
				 <snapshots><enabled>true</enabled></snapshots>
			 </pluginRepository>
		 </pluginRepositories>
	 </profile>
 </profiles>
<activeProfiles>
 <!--make the profile active all the time -->
 <activeProfile>nexus</activeProfile>
 </activeProfiles>
  <servers>
 	<server>
 		<id> releases </id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id> snapshots </id>
<username>admin</username>
<password>admin123</password>
 </server>
 </servers>
 </settings>

添加必要插件

1.Publish Over SSH用于连接远程服务器
2.Deploy to container插件用于把打包的应用发布到远程服务器
3.Maven Integration plugin 如果需要创建maven项目必选

配置待发版的远程服务器

去系统设置里配置Publish over SSH
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值