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

來源:互聯網
上載者:User

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.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.