好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

Hudson插件开发简介.ppt

18页
  • 卖家[上传人]:大米
  • 文档编号:605431792
  • 上传时间:2025-05-20
  • 文档格式:PPT
  • 文档大小:114.50KB
  • / 18 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 单击此处编辑母版标题样式,,,单击此处编辑母版文本样式,,第二级,,第三级,,第四级,,第五级,,Hudson插件开发,,1,了解Hudson,,开发Hudson插件,2,,What is Hudson/Jenkins?,Hudson monitors executions of repeated jobs, such as building a software project or jobs run by cron. Among those things, current Hudson focuses on the following two jobs:,,,Building/testing software projects continuously,,,just like CruiseControl or DamageControl. In a nutshell, Hudson provides an easy-to-use so-called continuous integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. The automated, continuous build increases the productivity.,,,Monitoring executions of externally-run jobs,,,such as cron jobs and procmail jobs, even those that are run on a remote machine. For example, with cron, all you receive is regular e-mails that capture the output, and it is up to you to look at them diligently and notice when it broke. Hudson keeps those outputs and makes it easy for you to notice when something is wrong,.,3,,Hudson是一个CI服务器,,自动完成软件代码的编译和测试过程。

      使用CI Server会使您的工作变得容易简单、持续,自动编译过程帮助软件开发团队减少项目风险,提高工作效率和软件产品质量1、发现bug更加容易;,,2、 提供快速的反馈;,,3、 隔离问题;,,4、 确保一个持续可靠的build,4,,Features,,Easy installation,,Easy configuration,,Change set support,,Permanent links,,RSS/E-mail/IM Integration,,After-the-fact tagging,,JUnit/TestNG,,Distributed builds,,,Plugin Support,: Hudson can be extended via 3rd party plugins. You can write plugins to make Hudson support tools/processes that your team uses.,,,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, Widget,,6,,编写Hudson插件,搭建基本环境,,开发与调试,,发布与部署,7,,搭建基本环境,,JDK必须是1.6以上的,,Maven 必须是2.0以上,8,,Maven配置,,修改settings.xml 文件,加入下面的内容。

      org.jvnet.hudson.tools,,,,,,,工程创建,,进入插件工程所要放到目录,使用maven命令创建工程,,$ mvn -cpu hpi:create,,提示你填写 groupId(包名)和 artifactId(项目工程名),,,如果使用eclipse开发,可使用maven命令导入eclipse工程结构,,$ mvn -DdownloadSources=true -DdownloadJavadocs=true -DoutputDirectory=target/eclipse-classes eclipse:eclipse,,如果eclipse带有maven的插件,则可免去此步,直接使用eclipse导入maven项目9,,插件的开发,,,,引入成功后,会显示如示结构工程中会带有官方的helloworld10,,插件实现类HelloWorldBuilder是我们所要编写的插件类,需实现相应的Hudson扩展点插件的文件包对此插件的一些配置、展现的页面3、index.jelly,,插件的基本描述信息4、pom.xml,,maven配置文件,打包时用到11,,插件的调试,,运行测试,,在工程目录下,运行,mvn hpi:run,,会启动自带的,jetty,。

      在启动调试之前,你先确定端口,8080,没被占用,如果被占用个,我们可以用命令,mvn hpi:run –Djetty.port=****,来更改端口号,,,打开浏览器,,即可进入,hudson,页面,查看、运行插件了12,,,debug测试,,启动,debug,模式,,运行,mvnDebug hpi:run,,启动,可通过,8000,端口进行远程调试如果不想用,8000,端口,需运行以下命令启动,,,set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n,,,mvn hpi:run,,,,Eclipse,中进行调试,,在工程上,使用,Remote Java Application,进行调试,,13,,插件的发布,,可采用以下两种方式发布在工程目录下,使用命令,mvn package,进行打包使用带,maven,插件的,eclipse,,在项目上右键,-> Run as -> Maven Package,,,打包完成后,会在工程目录下创建一个,target,目录,里面是打包的结果。

      其中,.hpi,是,Hudson,用到的插件包14,,插件的部署,,Hudson界面部署,,系统配置中,“插件管理”选项手动部署,,将hpi文件拷贝到web应用中,hudson目录下的WEB-INF/plugins下部署完成后,重启Hudson即可生效,15,,更多内容16,,佛高一尺,道高一丈,,相信大家会对hudson插件有更好的了解,17,,Thank You,,18,。

      点击阅读更多内容
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.