Jenkins中使用checkstyle, coverage, pmd, findbugs plugin

来源:互联网 发布:软件实施工程师待遇 编辑:程序博客网 时间:2024/06/06 12:38

1. 安装启动Jenkins之后,在manage jenkins里,选择manage plugin,在available tab里面安装相关plugins

FindBugs Plug-in
This plug-in collects the FindBugs analysis results of the project modules and visualizes the found warnings.
If you like this open source plug-in please consider supporting my work by buying my Android game Inca Trails.

Jenkins Cobertura Plugin
This plugin integrates Cobertura coverage reports to Jenkins.

PMD Plug-in
This plug-in collects the PMD analysis results of the project modules and visualizes the found warnings.
If you like this open source plug-in please consider supporting my work by buying my Android game Inca Trails.

Checkstyle Plug-in
This plug-in collects the Checkstyle analysis results of the project modules and visualizes the found warnings.
If you like this open source plug-in please consider supporting my work by buying my Android game Inca Trails.

Jenkins Sonar Plugin
Quickly benefit from Sonar, an open-source dashboard based on many analysis tools like Checkstyle, PMD and Cobertura.
实际就是把对应的 *.hpi/*.jpi 文件下载到本地的$JENKINS_HOME/plugins目录。

如果在available里面看不到东西,记得去Advanced看看是不是proxy,update都ok。也可以手动下载对应的plugin然后把文件下载到$JENKINS_HOME/plugins目录。

如果你对plugin的消息有兴趣,可以关注 plugin版本的RSS(orhere) or Twitter.


2. 在manage jenkins里面,configure system,配置sonar信息


3. 创建新的job,或者在已经的job(这里我创建的是freestyle的job)里面点击configure

3.1 配置maven generate site report,项目pom本身确保有report的配置 (Goals and options: deploy site)


Note: 因为sonar也会做checkstyle,pmd等等的测试,我试过只使用sonar提供的result (把gole改成mvn deploy -DskipTests=true),结果jekins的checkstyle plugin,pmd plugin无法解析sonar生成的checkstyle pmd xml,权衡之下,只保留了sonar的report

3.2 配置plugins,在post-build actions里面选择checkstyle,findbus,pmd,publish cobertura coverage report(pattern: **/coverage*.xml),同时可以配置sonar,下图右部分ps:这些插件可以通过拖拉自由调整执行顺序,配置完之后在job里可以看到多了findbugs, sonar等等的link,下图左部分。


4. 如果load build成功,可以在Job页面看到对应的插件的具体信息了。


Jekins安装plugin

https://wiki.jenkins-ci.org/display/JENKINS/Plugins


其他常用插件

Ant Plugin
This plugin adds Apache Ant support to Jenkins.

Blame Upstream Committers
A simple plugin that allows downstream jobs to mail upstream committers when the build fails.
    
Build Graph View Plugin
This plugin visualize builds relations as a graph.
    
Build Pipeline Plugin
This plugin renders upstream and downstream connected jobs that typically form a build pipeline. In addition, it offers the ability to define manual triggers for jobs that require intervention prior to execution, e.g. an approval process outside of Jenkins.
    
build-name-setter
This plug-in sets the display name of a build to something other than #1, #2, #3, ...
    
Build-timeout Plugin
This plugin allows builds to be automatically terminated after the specified amount of time has elapsed.
    
Change Log History
This plugin copies change log data to a later build when a build is deleted.

Claim plugin
Allow users to claim failed builds.
    
Compact Columns
More compact columns for showing last success and failure. Easier to understand, and takes less room in your view.
    
conditional-buildstep
A buildstep wrapping any number of other buildsteps, controlling their execution based on a defined condition (e.g. BuildParameter).
    
Configuration Slicing Plugin
Perform mass configuration of select project properties, including email, timer, discard old builds, and Maven configuration.
    
Credentials Plugin
This plugin allows you to store credentials in Jenkins.
    
Dashboard View
Customizable dashboard that can present various views of job information.
    
Dependency Graph Viewer Plugin
This plugin shows a dependency graph of the projects. It uses dot (from graphviz) for drawing.
    
Display Upstream Changes
Display upstream changes plugin.
    
Downstream buildview plugin
This plug-in allows you to view the full status all the downstream builds so that we can graphically see that everything for this build has been completed successfully.
       
Environment Injector Plugin
This plugin makes it possible to set an environment for the builds.
    
Fail The Build Plugin
Set or change the build result to test job configurations - notifiers, publishers, promotions, build pipelines, etc.
    
Favorite
This plugin allows users to favorite a job.

Git Plugin
This plugin integrates GIT with Jenkins.
    
Green Balls
Because green is better than blue! For color blind support configure user property.
    
Hudson Grinder plugin
This plugin will parse log files from The Grinder performance tests.
    
Hudson Locks and Latches plugin
This plugin adds locking and latch functionality to Hudson.
    
Hudson Personal View
This plugin provides a view where the selection of jobs to this view is attached to a user
    
Hudson Post build task
This plugin allows to execute a batch/shell task depending on the build log output.
    
Javadoc Plugin
This plugin adds Javadoc support to Jenkins.

Jenkins description setter plugin
This plugin sets the description for each build, based upon a RegEx test of the build log file.
    
Jenkins disk-usage plugin
This plugin counts disk usage.
    
Jenkins GIT client plugin
Shared library plugin for other Git related Jenkins plugins.
    
Jenkins Multijob plugin
This plugin is a MultiJob plugin.
    
Jenkins SSH Slaves plugin
This plugin allows you to manage slaves running on \*nix machines over SSH.
    
Jenkins user build vars plugin
This plugin is used to set user build variables: jenkins user name and id.
    
JobConfigHistory Plugin
Job history plugin for Jenkins.
    
Join plugin
This plugin allows a job to be run after all the immediate downstream jobs have completed.  
    
Mailer
This plugin allows you to configure email notifications. This is a break-out of the original core based email component.
    
Maven Project Plugin
Jenkins plugin for building Maven 2/3 jobs via a special project type.
    
Monitoring
Hudson/Jenkins' monitoring with JavaMelody. Open report after installation.
    
Monitoring external jobs
Adds the ability to monitor the result of externally executed jobs.
    
Nested View Plugin
View type to allow grouping job views into multiple levels instead of one big list of tabs.
    
Node and Label parameter plugin
This plugin adds two new parameter types to job configuration - node and label, this allows to dynamically select the node where a job/project should be executed.
              
Parameterized Trigger Plugin
This plugin lets you trigger new builds when your build has completed, with various ways of specifying parameters for the new build.
    
Performance Plugin
This plugin integrates JMeter reports and the JUnit reports to Hudson.
    
Plot plugin
This plugin provides generic plotting (or graphing) capability.
    
Priority Sorter Plugin
This plugin allows for the build queue to be sorted based on pre-assigned priorities for each job.
    
Radiator View Plugin
Adds a new high visibility view of project status.
    
Run Condition Plugin
Core conditions to select whether to execute a build step or publisher. Used by the [Flexible Publish Plugin] and the [Conditional BuildStep Plugin].
    
SCM API Plugin
This plugin provides a new enhanced API for interacting with SCM systems.
    
Sectioned View Plugin
Adds a new view that can be organised into different sections.
   
SSH Agent Plugin
This plugin allows you to provide SSH credentials to builds via a ssh-agent in Jenkins.
    
SSH Credentials Plugin
This plugin allows you to store SSH credentials in Jenkins.
    
SSH plugin
This plugin executes shell commands remotely using SSH protocol.
    
Static Analysis Utilities
This plug-in provides utilities for the static code analysis plug-ins.
If you like this open source plug-in please consider supporting my work by buying my Android game Inca Trails.
    
Subversion Plugin
This plugin adds the Subversion support (via SVNKit) to Jenkins.
    
TestLink Plugin
This plugin integrates Jenkins and TestLink.
    
thinBackup
Backups the most important global and job specific configuration files.

0 0
原创粉丝点击