Hudson插件开发简介_第1页
Hudson插件开发简介_第2页
Hudson插件开发简介_第3页
Hudson插件开发简介_第4页
Hudson插件开发简介_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Hudson插件开发1了解Hudson开发Hudson插件2WhatisHudson/Jenkins?

Hudsonmonitorsexecutionsofrepeatedjobs,suchasbuildingasoftwareprojectorjobsrunbycron.Amongthosethings,currentHudsonfocusesonthefollowingtwojobs:Building/testingsoftwareprojectscontinuously,justlikeCruiseControlorDamageControl.Inanutshell,Hudsonprovidesaneasy-to-useso-calledcontinuousintegrationsystem,makingiteasierfordeveloperstointegratechangestotheproject,andmakingiteasierforuserstoobtainafreshbuild.Theautomated,continuousbuildincreasestheproductivity.

Monitoringexecutionsofexternally-runjobs,suchascronjobsandprocmailjobs,eventhosethatarerunonaremotemachine.Forexample,withcron,allyoureceiveisregulare-mailsthatcapturetheoutput,anditisuptoyoutolookatthemdiligentlyandnoticewhenitbroke.Hudsonkeepsthoseoutputsandmakesiteasyforyoutonoticewhensomethingiswrong.3Hudson是一个CI服务器自动完成软件代码的编译和测试过程。使用CIServer会使您的工作变得容易简单、持续,自动编译过程帮助软件开发团队减少项目风险,提高工作效率和软件产品质量。 1、发现bug更加容易; 2、提供快速的反馈; 3、隔离问题; 4、确保一个持续可靠的build4FeaturesEasyinstallationEasyconfigurationChangesetsupportPermanentlinksRSS/E-mail/IMIntegrationAfter-the-facttaggingJUnit/TestNGDistributedbuildsPluginSupport:Hudsoncanbeextendedvia3rdpartyplugins.YoucanwritepluginstomakeHudsonsupporttools/processesthatyourteamuses.

5可扩展的功能点Hudson定义了一些功能点,是以接口或者抽象类出现的。需要对某个功能作扩展时,需要实现相应的接口或者抽象类。目前可扩展的功能点(78个):AdministrativeMonitor,AuthorizationStrategy,Axis,BuildWrapper,Builder,CLICommand,ChangeLogAnnotator,Cloud,ComputerConnector,ComputerLauncher,ComputerListener,ComputerPinger,ConsoleAnnotationDescriptor,ConsoleAnnotatorFactory,ConsoleLogFilter,CrumbIssuer,Downloadable,ExtensionFinder,,,ItemListener,Job,JobProperty,LabelAtomProperty,LabelFinder,LauncherDecorator,Lifecycle,ListViewColumn,LoadPredictor,MailAddressResolver,ManagementLink,MatrixAggregatable,MatrixAggregator,MyViewsTabBar,Node,NodeMonitor,NodeProperty,Notifier,PageDecorator,ParameterDefinition,PeriodicWork,PluginServletFilter,PluginStrategy,ProcessKiller,QueueDecisionHandler,QueueSorter,QueueTaskDispatcher,Recorder,RepositoryBrowser,RestartListener,RetentionStrategy,RootAction,Run,RunListener,SCM,SCMListener,SaveableListener,SecurityRealm,Solution,SubTaskContributor,TestDataPublisher,TestResultParser,ToolInstallation,ToolInstaller,ToolLocationTranslator,ToolProperty,TopLevelItem,TransientProjectActionFactory,TransientViewActionFactory,Trigger,UDPBroadcastFragment,UpdateCenterConfiguration,UserNameResolver,UserProperty,View,ViewJobFilter,ViewsTabBar,Widget6编写Hudson插件搭建基本环境开发与调试发布与部署7搭建基本环境JDK必须是1.6以上的Maven必须是2.0以上8Maven配置修改settings.xml文件,加入下面的内容。<settings> <pluginGroups> <pluginGroup>org.jvnet.hudson.tools</pluginGroup> </pluginGroups></settings>工程创建 进入插件工程所要放到目录,使用maven命令创建工程 $mvn-cpuhpi:create 提示你填写groupId(包名)和artifactId(项目工程名) 如果使用eclipse开发,可使用maven命令导入eclipse工程结构 $mvn-DdownloadSources=true-DdownloadJavadocs=true-DoutputDirectory=target/eclipse-classeseclipse:eclipse 如果eclipse带有maven的插件,则可免去此步,直接使用eclipse导入maven项目。9插件的开发

引入成功后,会显示如示结构。工程中会带有官方的helloworld。10插件实现类。

HelloWorldBuilder是我们所要编写的插件类,需实现相应的Hudson扩展点。插件的文件包。

对此插件的一些配置、展现的页面。3、index.jelly 插件的基本描述信息。4、pom.xml maven配置文件,打包时用到。11插件的调试运行测试 在工程目录下,运行mvnhpi:run,会启动自带的jetty。 在启动调试之前,你先确定端口8080没被占用,如果被占用个,我们可以用命令mvnhpi:run–Djetty.port=****来更改端口号 打开浏览器

即可进入hudson页面,查看、运行插件了。12debug测试启动debug模式 运行mvnDebughpi:run

启动,可通过8000端口进行远程调试。 如果不想用8000端口,需运行以下命令启动

setMAVEN_OPTS=-Xdebug-Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n

mvnhpi:runEclipse中进行调试 在工程上,使用RemoteJavaApplication进行调试13插件的发布可采用以下两种方式发布。在工程目录下,使用命令mvnpackage进行打包。使用带maven插件的eclipse,在项目上右键->Runas->MavenPackage打包完成后,会在工程目录下创建一个ta

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论