博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Jenkins常用插件之Deploy Plugin
阅读量:5159 次
发布时间:2019-06-13

本文共 6305 字,大约阅读时间需要 21 分钟。

该插件主要运用在项目中,功能是“将成功编译的War/Jar包部署到远程的应用服务器上,该功能的实现主要基于Cargo。当前支持的应用服务器版本如下: 

- Tomcat 4.x/5.x/6.x/7.x 
- JBoss 3.x/4/x 
- Glassfish 2.x/3.x 
以下是使用该插件的具体步骤:

第一步:Deploy Plugin下载和安装

  1. 在网上下载插件,下载文件为deploy.hpi
  2. 在jenkins中安装Deploy Plugin插件,系统管理–>插件管理–>高级上传deploy.hpi进行安装 
    这里写图片描述

第二步:编译工具maven的下载和配置

  1. 在网上下载安装包apache-maven-3.3.9-bin.zip
  2. 解压apache-maven-3.3.9-bin.zip至D:\BuildTool
  3. 设置环境变量 
    —新建系统变量:MAVEN_HOME,值为:D:\BuildTool\apache-maven-3.3.9 
    —设置PATH变量,追加值为:;%MAVEN_HOME%\bin
  4. 验证环境变量–打开CMD,输入mvn -v,查看结果 
    这里写图片描述
  5. 修改maven的settings.xml文件,在pluginGroups节点增加cargo插件,进行远程部署 
    这里写图片描述

第三步:修改Tomcat配置

  1. 修改tomcat的tomcat-users.xml文件,增加tomcat的manager用户 
    这里写图片描述
  2. 启动tomcat

第四步:新建示例maven项目WebProject

  1. 运用Eclipse创建一个maven项目,名称为
  2. 修改构建文件pom.xml,主要注意build节点的配置
4.0.0
me.gacl.maven
WebProject
war
0.0.1-SNAPSHOT
WebProject Maven Webapp
http://maven.apache.org
junit
junit
3.8.1
test
WebProject
org.codehaus.cargo
cargo-maven2-plugin
1.2.3
tomcat7x
remote
runtime
admin
admin
http://192.168.1.100:8080/manager
deploy
redeploy
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53

第五步:在Jenkins中构建项目mavenTestWeb

  1. 创建一个maven项目的Job,名称为mavenTestWeb 
    这里写图片描述
  2. 添加Job的详细描述信息 
    这里写图片描述
  3. 配置源码管理 
    这里写图片描述
  4. 配置构建触发器 
    这里写图片描述
  5. 配置构建 
    这里写图片描述
  6. 构建后操作配置 
    这里写图片描述
  7. 构建验证,查看控制台输出的日志信息
Started by user anonymousBuilding in workspace D:\Program Files\Jenkins\jobs\mavenTestWeb\workspace Checking out a fresh workspace because there's no workspace at D:\Program Files\Jenkins\jobs\mavenTestWeb\workspace Cleaning local Directory . Checking out https://pc-20160123cxrq/svn/MyRepository/trunk/%E6%BA%90%E4%BB%A3%E7%A0%81/WebProject at revision '2016-04-17T14:35:01.952 +0800' A pom.xml A .classpath A .project A .settings A .settings\org.eclipse.jdt.core.prefs A .settings\org.eclipse.m2e.core.prefs A src A src\main A src\main\resources A src\main\webapp A src\main\webapp\WEB-INF A src\main\webapp\WEB-INF\web.xml A src\main\webapp\index.jsp At revision 39 No changes for https://pc-20160123cxrq/svn/MyRepository/trunk/%E6%BA%90%E4%BB%A3%E7%A0%81/WebProject since the previous build [workspace] $ cmd.exe /C '"D:\CItools\apache-maven-3.3.9\bin\mvn.cmd clean install -Dmaven.test.skip=true && exit %%ERRORLEVEL%%"' [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building WebProject Maven Webapp 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ WebProject --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ WebProject --- [WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ WebProject --- [INFO] No sources to compile [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ WebProject --- [INFO] Not copying test resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ WebProject --- [INFO] Not compiling test sources [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ WebProject --- [INFO] Tests are skipped. [INFO] [INFO] --- maven-war-plugin:2.2:war (default-war) @ WebProject --- [INFO] Packaging webapp [INFO] Assembling webapp [WebProject] in [D:\Program Files\Jenkins\jobs\mavenTestWeb\workspace\target\WebProject] [INFO] Processing war project [INFO] Copying webapp resources [D:\Program Files\Jenkins\jobs\mavenTestWeb\workspace\src\main\webapp] [INFO] Webapp assembled in [20 msecs] [INFO] Building war: D:\Program Files\Jenkins\jobs\mavenTestWeb\workspace\target\WebProject.war [INFO] WEB-INF\web.xml already added, skipping [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ WebProject --- [INFO] Installing D:\Program Files\Jenkins\jobs\mavenTestWeb\workspace\target\WebProject.war to C:\.m2\repository\me\gacl\maven\WebProject\0.0.1-SNAPSHOT\WebProject-0.0.1-SNAPSHOT.war [INFO] Installing D:\Program Files\Jenkins\jobs\mavenTestWeb\workspace\pom.xml to C:\.m2\repository\me\gacl\maven\WebProject\0.0.1-SNAPSHOT\WebProject-0.0.1-SNAPSHOT.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.037 s [INFO] Finished at: 2016-04-17T14:35:05+08:00 [INFO] Final Memory: 13M/220M [INFO] ------------------------------------------------------------------------ Parsing POMs [workspace] $ "D:\Program Files\Java\jdk1.7.0_79/bin/java" -cp "D:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven31-agent-1.5.jar;D:\CItools\apache-maven-3.3.9\boot\plexus-classworlds-2.5.2.jar;D:\CItools\apache-maven-3.3.9/conf/logging" jenkins.maven3.agent.Maven31Main D:\CItools\apache-maven-3.3.9 "D:\Program Files\Jenkins\war\WEB-INF\lib\remoting-2.53.3.jar" "D:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven31-interceptor-1.5.jar" "D:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.5.jar" 6271 <===[JENKINS REMOTING CAPACITY]===>channel started Executing Maven: -B -f D:\Program Files\Jenkins\jobs\mavenTestWeb\workspace\pom.xml clean install [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building WebProject Maven Webapp 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ WebProject --- [INFO] Deleting D:\Program Files\Jenkins\jobs

转载于:https://www.cnblogs.com/onlyll-051/p/6078352.html

你可能感兴趣的文章
HTML5音频播放,歌词同步,及视频播放功能(JPlayer、JWPlayer、VideoJS)
查看>>
剑指offer 顺时针打印矩阵
查看>>
关于Core Location-ios定位
查看>>
破解中国电信华为无线猫路由(HG522-C)自己主动拨号+不限电脑数+iTV
查看>>
Windows 自己主动关机命令 shuntdown
查看>>
ArcEngine 10.2 汉化问题
查看>>
现在的心情
查看>>
Python-列表练习
查看>>
Python selenium —— 一定要会用selenium的等待,三种等待方式解读
查看>>
怎样group by一列 select多列
查看>>
Educational Codeforces Round 42 C. Make a Square(字符串操作)
查看>>
LSTM缓解梯度消失的原因
查看>>
JS中的三种弹出式消息提醒(警告窗口、确认窗口、信息输入窗口)的命令是什么?...
查看>>
noip模拟赛 洗衣
查看>>
省选模拟赛 礼
查看>>
HDU1698+线段树
查看>>
ASP.NET没有魔法——ASP.NET MVC 与数据库之EntityFramework配置与连接字符串
查看>>
C#进阶系列——WebApi 传参详解
查看>>
生成Excel.xlsx文件 iOS
查看>>
python之面向对象编程
查看>>