Checkstyle Plugin

Plugin Information

Plugin ID checkstyle
Latest Release 3.35-h-1
Latest Release Date Mar 15, 2013
Sources Github
Support Eclipse Hudson Forum
Issue Tracking Eclipse Bugzilla

This plugin generates the trend report for Checkstyle, an open source static code analysis program. 

Quick Overview

Installation Requirements
This plug-in requires the utility plug-in "analysis-core" (called "Static Analysis Utilities" in the update manager). Please ensure that the latest version of this plug-in is also installed.

Description


 
This plug-in is supported by the Static Analysis Collector plug-in that collects different analysis results and shows the results in aggregated trend graphs. Additionally, health reporting and build stability is also based on the aggregated results.

The Checkstyle plug-in scans for checkstyle-result.xml files in the build workspace and reports the number of warnings found. This plug-in is part of the suite of static code analysis plug-ins that are documented on a separate WIKI page.

The following features are provided by this plug-in:

  • Configuration of the files to scan after a build.
  • Build summary showing the new and fixed warnings of a build
  • Several trend reports showing the number of warnings per build
  • Overview of the found warnings per module, package, category, or type
    • Parsing of Maven pom.xml or Ant build.xml configuration files to obtain the module or project name
    • Parsing of Java files to obtain the package or name space name
  • Detail reports of the found warnings optionally filtered by severity (or new and fixed)
    • Short messages is read from the report file
    • Detailed description is read from the Checkstyle library
  • Colored HTML display of the corresponding source file and warning lines:
    • Direct link to the warning line
    • Highlighting of single lines as well as line ranges
    • Highlighting of multiple line ranges per warning (different color for primary range)
    • Tool tip describing the warning message
  • Failure threshold to mark a build as unstable
  • Configurable project health support
  • Remote API to export the build quality and found warnings
  • Works with the freestyle and native m2 build option of Hudson (activated on goal checkstyle:checkstyle or site)
  • Localization available for: DE, JA (Please help to localize checkstyle for your locale!)

Labels:

plugin-maven plugin-maven Delete
plugin-report plugin-report Delete
supports-dashboard-view supports-dashboard-view Delete
tier3-compat-plugin tier3-compat-plugin Delete
tier2-plugin tier2-plugin Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Sep 02, 2008

    Mathieu Cousy says:

    Hello, We have just updated the plugin to 1.13version and it seems there is a p...

    Hello,

    We have just updated the plugin to 1.13version and it seems there is a problem with the icon management.

    Actually  in the dashboard we have lost the tooltips and images (replaced by '%') on the projects using checkstyle plugins.

    Is there anything to configure in this last version ?

     Thanks in advance,

    Mathieu 

    1. Sep 03, 2008

      Ulli Hafner says:

      This is a bug. Could you please file an issue? Thanks, Ulli

      This is a bug. Could you please file an issue?

      Thanks, Ulli

      1. Sep 03, 2008

        Mathieu Cousy says:

        Ok, I have open an issue : https://hudson.dev.java.net/issues/show_bug.cgi?id=23...
  2. Jan 20, 2009

    Zaccret says:

    Hi, Could you tell us which Checkstyle and Checkstyle Maven Plugin versions can...

    Hi,

    Could you tell us which Checkstyle and Checkstyle Maven Plugin versions can be used with this plugin ?

    Thanks in advance.

    Zac

    1. Jan 21, 2009

      Ulli Hafner says:

      Actually there should be no hard dependencies to a specific version. We are usin...

      Actually there should be no hard dependencies to a specific version. We are using the latest checkstyle and maven plugin.

  3. Sep 16, 2009

    Mohamed Osman says:

    It seems to get the Source Code Visualization feaute you must have Administer pe...

    It seems to get the Source Code Visualization feaute you must have Administer permission.

    Error:

    Access Denied

    ****** is missing the Administer permission

    Is there any reason for this? anyway to get this without setting your self up with admin rights?

    Thanks

    -Mohamed

  4. Sep 24, 2009

    Kyle Hebert says:

    Hey guys, Is there anyway to configure this plugin to look in a directory besid...

    Hey guys,

    Is there anyway to configure this plugin to look in a directory besides "target" to find the checkstyle-result.xml file.

    In my pom.xml I have something like this:

    <build>
    <directory>build/jars</directory>
    ...
    </build>

    The checkstyle:checkstyle goal runs fine and the report gets put in this directory but this plugin can't find it. If I change the directory back to "target" everything works fine...

    Any ideas or suggestions would be very appreciated.

    Thanks,

    Kyle

  5. Oct 02, 2009

    Christian Schneider says:

    Hi, I have a further question considering the rights management: In our setup,...

    Hi,

    I have a further question considering the rights management:

    In our setup, the links to the highlighted code are available when an admin is logged in only.

    It might make sense, that anonymous user can't see that.

    However, even our subproject (job) managers ain't permitted to get the links.

    Is that desired behavior?

    cheers,

    Christian

  6. Feb 02, 2010

    xavier vignon says:

    Hi, I've got a problem with this plugin : after successful installation (and in...

    Hi,

    I've got a problem with this plugin : after successful installation (and installation of the static analysis utilities plugin), when i go on job configuration page, it does not display correctly, and in my jonas console i've got a JellyTagException ... caused by java.lang.NoClassDefFoundError: hudson/tasks/BuildStepMonitor.

    Anyone can help me ??

    Thx a lot

    Xavier

    1. Feb 21, 2010

      Romain Seguy says:

      You're using a version of the plugin which is built against a more recent versio...

      You're using a version of the plugin which is built against a more recent version of Hudson ==> Either downgrade the plugin or upgrade your Hudson version.

  7. May 11, 2010

    Skifflad says:

    Just upgraded to Hudson 1.357 with Checkstyle Plug-In 3.6 and Static Analysis Co...

    Just upgraded to Hudson 1.357 with Checkstyle Plug-In 3.6 and Static Analysis Collector 1.5.

    Checkstyle is running ok, but the plug-in is reporting a red ball error on each specific build page where there are checkstyle warnings to report. When you click on Warnings, you see the Warnings page with a correct Summary, but the details section is only showing the Tab headings (Packages, Files, Warnings, Details) but nothing further ?

    Anybody else seeing same ?

    1. May 11, 2010

      Trent McClenahan says:

      Yep, I've got the same here.... haven't been able to work it out yet... fingers ...

      Yep, I've got the same here.... haven't been able to work it out yet... fingers crossed the guys are on to it!

      1. May 13, 2010

        Skifflad says:

        I've just added an issue.

        I've just added an issue.

  8. Jun 03, 2010

    Sven Oppermann says:

    I want to fail the build if there is a new warning in checkstyle. But if i set t...

    I want to fail the build if there is a new warning in checkstyle. But if i set the boundary  for "new" under the "red ball" to one, it doesnt work. Do i miss something !?!?!

    1. Jun 04, 2010

      Ulli Hafner says:

      You need to use '0' if the build should fail on 1 warning! What does the checks...

      You need to use '0' if the build should fail on 1 warning!

      What does the checkstyle plug-in report in the console?

      E.g.:

      [CHECKSTYLE] Found 113  annotations (0 high, 113 normal, 0 low)
      [CHECKSTYLE] Setting build status to UNSTABLE since total number of new annotations exceeds the threshold 0
      
      1. Jun 04, 2010

        Sven Oppermann says:

        My log looks like: [CHECKSTYLE] Successfully parsed file /home/workarea/zvs/wo...

        My log looks like:

        [CHECKSTYLE] Successfully parsed file /home/workarea/zvs/workspace/zvs-continuous_0.1.0/zvs/application/model/impl/target/checkstyle-result.xml of module de.mms_dresden.zvs.application.model.impl with 1 warnings.
        [hudson] Archiving ...

        It is a maven job in hudson and the project itself is a multi modul maven project. I set the boundary to 0 but it is still not working...

        1. Jun 24, 2010

          Sven Oppermann says:

          i digged deeper and i couldnt find a solution. What i did: 1. created a "Hello ...

          i digged deeper and i couldnt find a solution. What i did:

          1. created a "Hello World " maven app: "mvn archetype:create -DgroupId=... -DartifactId=helloWorld" and added the checkstyle plugin to the reporting section

          2. installed a clean hudson

          3. added "Checkstyle Plug-in  3.8" and "Static Analysis Collector Plug-in 1.6" to hudson

          4. created a new maven job in hudson for this "hello world" project

                mvn goal: "mvn clean install site"
                checkstyle settings: "red ball (total): 1" "red ball(new): 0"

          The output:

           -------------------------------------------------------
           T E S T S
          -------------------------------------------------------
          Running de.mms_dresden.zvs.testproject.AppTest
          Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.063 sec
          
          Results :
          
          Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
          
          [HUDSON] Zeichne Testergebnisse auf
          [INFO] [jar:jar {execution: default-jar}]
          [INFO] Building jar: D:\projekte\hudson\checkstyle-3.8\work\jobs\helloWorld\workspace\helloWorld\target\helloWorld-1.0-SNAPSHOT.jar
          [INFO] [install:install {execution: default-install}]
          [INFO] Installing D:\projekte\hudson\checkstyle-3.8\work\jobs\helloWorld\workspace\helloWorld\target\helloWorld-1.0-SNAPSHOT.jar to D:\projekte\hudson\checkstyle-3.8\work\jobs\helloWorld\workspace\.repository\de\mms_dresden\zvs\testproject\helloWorld\1.0-SNAPSHOT\helloWorld-1.0-SNAPSHOT.jar
          [INFO] [site:site {execution: default-site}]
          [INFO] Generating "Project Team" report.
          [INFO] Generating "Issue Tracking" report.
          [INFO] Generating "Checkstyle" report.
          [INFO]
          [INFO] There are 12 checkstyle errors.
          [WARNING] Unable to locate Source XRef to link to - DISABLED
          [INFO] Generating "Continuous Integration" report.
          [INFO] Generating "Project Plugins" report.
          [INFO] Generating "Dependencies" report.
          [INFO] Generating "Plugin Management" report.
          [INFO] Generating "Mailing Lists" report.
          [INFO] Generating "Source Repository" report.
          [INFO] Generating "Project Summary" report.
          [INFO] Generating "About" report.
          [INFO] Generating "Project License" report.
          [CHECKSTYLE] Successfully parsed file D:\projekte\hudson\checkstyle-3.8\work\jobs\helloWorld\workspace\helloWorld\target\checkstyle-result.xml of module helloWorld with 12 warnings.
          [HUDSON] Archiving site from D:\projekte\hudson\checkstyle-3.8\work\jobs\helloWorld\workspace\helloWorld\target\site to D:\projekte\hudson\checkstyle-3.8\work\jobs\helloWorld\site\helloWorld
          [HUDSON] Archiving D:\projekte\hudson\checkstyle-3.8\work\jobs\helloWorld\workspace\helloWorld\pom.xml to D:\projekte\hudson\checkstyle-3.8\work\jobs\helloWorld\modules\de.mms_dresden.zvs.testproject$helloWorld\builds\2010-06-24_14-19-43\archive\de.mms_dresden.zvs.testproject\helloWorld\1.0-SNAPSHOT\pom.xml
          [HUDSON] Archiving D:\projekte\hudson\checkstyle-3.8\work\jobs\helloWorld\workspace\helloWorld\target\helloWorld-1.0-SNAPSHOT.jar to D:\projekte\hudson\checkstyle-3.8\work\jobs\helloWorld\modules\de.mms_dresden.zvs.testproject$helloWorld\builds\2010-06-24_14-19-43\archive\de.mms_dresden.zvs.testproject\helloWorld\1.0-SNAPSHOT\helloWorld-1.0-SNAPSHOT.jar
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD SUCCESSFUL
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 1 minute 18 seconds
          [INFO] Finished at: Thu Jun 24 14:21:04 CEST 2010
          [INFO] Final Memory: 39M/254M
          [INFO] ------------------------------------------------------------------------
          channel stopped
          Finished: SUCCESS
          
          

          should i create a ticket?

          1. Jun 25, 2010

            Ulli Hafner says:

            I see, you are using a m2 build. Currently the thresholds don't work for m2 buil...

            I see, you are using a m2 build. Currently the thresholds don't work for m2 builds: see http://issues.hudson-ci.org/browse/HUDSON-4912.

            1. Jun 25, 2010

              Sven Oppermann says:

              i found a workaround. if i activate the "Checkstyle Plugin " and the "Static Ana...

              i found a workaround. if i activate the "Checkstyle Plugin " and the "Static Analysis Collector Plug-in"  and set the bounderies on the "Static Analysis Collector Plug-in", it fails the build.

  9. Oct 26, 2010

    suri says:

    Hi I am trying to integrate checkstyle plugin to Hudson manually, The instructio...

    Hi
    I am trying to integrate checkstyle plugin to Hudson manually, The instructions say download and copy the .hpi file into the hudson plugin directory, but when i try to download it downloads a checkstyle.zip file and is an exploder war file.Where can i get the checkstyle.hpi file to copy into the hudson plugin directory.

    1. Oct 26, 2010

      Stefan Bäumler says:

      http://updates.hudson-labs.org/latest/checkstyle.hpi or the corresponding versi...
  10. Nov 16, 2010

    Fabian Baboschi says:

    Is there any way to send an email to the commiter(s) (without failing the build)...

    Is there any way to send an email to the commiter(s) (without failing the build) when someone commits a new checkstyle warning (basically new checkstyle warnings are found)?

    Thanks.

    1. Dec 15, 2010

      Ulli Hafner says:

      No that is not possible. That would be a nice feature request for the email comp...

      No that is not possible. That would be a nice feature request for the email component of Hudson.

  11. Dec 14, 2010

    Steven Wood says:

    Hey, I installed the newest hudson and checkstyle-plugin version. I see the che...

    Hey,

    I installed the newest hudson and checkstyle-plugin version. I see the checkstyle trend at the right side and the output of my build tells me that there are 0 warnings read from the checkstyle file. So far so good ...

    My problem is that in the hudson overview of a project I only see the standard hudson menu with status, changes, build, delete ...

    When I installed the plugin the first time (3 or 4 months ago) there were some checkstyle icon(link) where I can get more information about checkstyle of the current project.

    I only see the trend and at a build the informatzion that the checkstyle file was load.

    Thnaks in advance

    1. Dec 15, 2010

      Ulli Hafner says:

      The link is only shown if there are warnings in a project.

      The link is only shown if there are warnings in a project.

  12. Jan 27, 2011

    Tomas Milian says:

    Hi, Not sure if it's a bug or not but just upgraded to checkstyle plugin v3.11...

    Hi,

    Not sure if it's a bug or not but just upgraded to checkstyle plugin v3.11along with the analysis-core, findbugs plugin, cpd. and all the reporters work except checkstyle. Hudson is v1.392 and Maven v2.1.0.

    All my jobs native Maven multi-module projects. Before I updated it would pick up all the checkstyle-result.xml files from all modules but now  this is what I get:

    [HUDSON]Collecting dependencies info
    [INFO] [checkstyle:checkstyle]
    [CHECKSTYLE] Skipping maven reporter: there is already a result available.
    [TASKS] Skipping maven reporter: there is already a result available.
    [HUDSON] Collecting dependencies info
    
    [INFO] \[checkstyle:check \[execution: default\]\]
    [CHECKSTYLE] Skipping maven reporter: there is already a result available.
    [TASKS] Skipping maven reporter: there is already a result available.
    [INFO] Preparing findbugs:check
    [INFO] Preparing findbugs:findbugs
    [WARNING] Removing: check from forked lifecycle, to prevent recursive invocation.
    [WARNING] Removing: check from forked lifecycle, to prevent recursive invocation.
    [WARNING] Removing: check from forked lifecycle, to prevent recursive invocation.
    [HUDSON] Collecting dependencies info
    [INFO] [resources:resources]
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Copying 1 resource
    [TASKS] Skipping maven reporter: there is already a result available.
    [INFO] [compiler:compile]
    [INFO] Nothing to compile - all classes are up to date
    [TASKS] Skipping maven reporter: there is already a result available.
    [HUDSON] Collecting dependencies info
    [INFO] [findbugs:findbugs]
    [INFO] Locale is en
    [FINDBUGS] Successfully parsed file D:\hudson_home\jobs\core_int\workspace\core_int\VOB_EA\core\core-modules\core-concurrent\target\findbugsXml.xml of module EA Core Concurrent Jar with 0 warnings.
    

    The checkstyle-result-xml file is being written on the target folder as it should, Maven CLI execution works fine also.

    The Maven build is not doing any of the site goals, just binding the checkstyle plugin to its default Maven lifecycle stage (verify).

    Sorry for writing this here but I tried to open a JIRA issue with no avail (I even signed up and everything).

    Thanks

    1. Feb 23, 2011

      Lammert Westerhoff says:

      I have exactly the same problem. Have you found a solution or has anyone else op...

      I have exactly the same problem. Have you found a solution or has anyone else opened a JIRA issue?

      Any help would be appreciated.