Unknown macro: {composition-setup}

import.css=^tan_deck.css

Name

CheckStyle plugin

Version

2.2

Product Versions

2.0.x and Higher

Author(s)

Stephan Paulicke

Maintainer(s)

Lilians Auvigne

Homepage

http://confluence.atlassian.com/display/BAMEXT/CheckStyle+Plugin

Price

Free

License

BSD

IssueTracking

http://developer.atlassian.com/jira/browse/BCHKSTYL

Subversion URL

https://svn.atlassian.com/svn/public/contrib/bamboo/bamboo-checkstyle-plugin/trunk/

Fisheye URL

http://svn.atlassian.com/fisheye/browse/public/contrib/bamboo/bamboo-checkstyle-plugin

Download JAR

bamboo-checkstyle-plugin-2.2.jar

Description/Features

A plugin that will parse and record CheckStyle reports

Usage

  1. Copy the bamboo-checkstyle-plugin-2.2.jar file into your <BAMBOO_HOME>/webapp/WEB-INF/lib directory and restart Bamboo. Think to remove the old version.
  2. In the configuration of your plan, there should be a new CheckStyle section on the 'Builder Configuration' tab. Here you can specify whether your plan generates CheckStyle reports, and if so, the location of the XML report file.
    1. New in version 2.2, You can configure an error or warning threshold which fail the build when checkstyle error/warnings exceed it
  3. That should be it, you should now see a CheckStyle tab on your Plan and on any new builds that generate CheckStyle report files.

Version Compatibility

Compatibility of Checkstyle Plugin versions (side) versus Bamboo versions (top).

 

  1.0-1.0.4  

  1.0.5  

  1.1-1.1.2  

  1.2-1.2.4  

  2.0-2.0.x  

2.1.x

2.2.x

  1.0-1.0.1  

 
 

 
 

 
 

 
 

 
 

  2.x  

 
 

 
 

 
 

 
 

 
 

Unknown macro: {roundrect}

= compatible
= not compatible
= compatibility unknown

Version History

Unknown macro: {deck}
Unknown macro: {card}

Version

Date

Description

2.2

May 18th 2008

Applied patch by Nicky Sandhu BCHKSTYL-16 : Fail build when checkstyle error/warnings exceed a threshold

2.1

September 9th 2008

Bugs fixing, see below

2.0

August 6th 2008

Bamboo 2.1 migration, Unifying the Look and Feel with the findbugs plugin, add Href on report maven 2 , and fixed bug

2.0-beta1

Jully 4th 2008

Bamboo 2.0 migration

1.0.0

August 30th 2007

initial version

1.0.1

October 29th 2007

fix reported bugs

Unknown macro: {card}

2.3

jiraissues: com.atlassian.confluence.extra.jira.exception.JiraIssueMacroException: com.atlassian.confluence.macro.MacroExecutionException: Unable to locate Jira server for this macro. It may be due to Application Link configuration.
Unknown macro: {card}

2.2

jiraissues: com.atlassian.confluence.extra.jira.exception.JiraIssueMacroException: com.atlassian.confluence.macro.MacroExecutionException: Unable to locate Jira server for this macro. It may be due to Application Link configuration.
Unknown macro: {card}

2.1

jiraissues: com.atlassian.confluence.extra.jira.exception.JiraIssueMacroException: com.atlassian.confluence.macro.MacroExecutionException: Unable to locate Jira server for this macro. It may be due to Application Link configuration.
Unknown macro: {card}

2.0

Fix of version Bamboo 2.0-beta1

jiraissues: com.atlassian.confluence.extra.jira.exception.JiraIssueMacroException: com.atlassian.confluence.macro.MacroExecutionException: Unable to locate Jira server for this macro. It may be due to Application Link configuration.
Unknown macro: {card}

2.0-beta1

Initial version Bamboo 2.x

jiraissues: com.atlassian.confluence.extra.jira.exception.JiraIssueMacroException: com.atlassian.confluence.macro.MacroExecutionException: Unable to locate Jira server for this macro. It may be due to Application Link configuration.
Unknown macro: {card}

Unscheduled

jiraissues: com.atlassian.confluence.extra.jira.exception.JiraIssueMacroException: com.atlassian.confluence.macro.MacroExecutionException: Unable to locate Jira server for this macro. It may be due to Application Link configuration.

Screenshots

  • No labels

30 Comments

  1. This look like just what we need, but I can't get it to pick up the checkstyle results. The project I'm using to test the plugin has ten checkstyle errors, but the graphs generated show zero errors. I'm pointing the plug in to the checkstyle-result.xml file (**/target/checkstyle-result.xml) is this the correct file?.

    1. hi,
      the plugin uses the standard atlassian FileVisitor. in my configuration i just put in the folder to look in, e.g. lib/qmb/reports/CheckStyle (this folder is located within the checkout).

      1. Hi Stephan,

        This hasn't helped. I don't have the folder lib/qmb/reports/CheckStyle. I also tried **/target (Removing the file name from my existing configuration).

        The Checkstyle plug in creates the following files in the target directory: checkstyle-checker.xml, checkstyle-header.txt and checkstyle-result.xml. And in the target/site directory  check-style.mtml and checkstyle.rss.

        I had presumed that the plugin was looking for the checkstyle-result.xml. Is this the case, or is the pluggin looking for another file?

        For futher information the PC tath I am testing the plug in on does not have internet access, the version of the maven-checkstyle-plugin that I am using is version 2.1. Perhaps the plugin requires a newer version of the plug in?

        Thanks,

        Peter

      2. Hi,
        I am getting a simmilar error to Peter's: the plugin always reports that there are 0 violations. It did report true values exactly once, then somehow seemed to not notice that checkstyle report contains some data. I have set the output dir to **/target/* or just target

  2. the graph seems sometimes to show false values.
    I reduced in a project the violations from about 50.000 to about 7, and the graph shows 450000.

    Is it possible to add value that displays the something like a rating ( violations / source code lines).

    Thanks in advance

    1. Hi,
      the graph shows a the avarage of a day at minimum. So if you've done some builds with 50000 violations and the dropped down to 7 the daily avarage might still be high. The rating might be possibly, due a lack of time I'm not able to do this ... but feel free to modify the plugin

  3. Hi, i found a small bug:

    If there are no 10 violations in the file the plugin crashes: 

     2007-10-18 12:59:20,859 ERROR [BAM:Default Queue:BuildExe] [CheckStyleBuildProcessor] Failed to parse artifact result file "checkstyle_errors.xml"
    java.lang.IndexOutOfBoundsException: Index: 8, Size: 8                                                              
       at java.util.ArrayList.RangeCheck(ArrayList.java:546)                                                              
       at java.util.ArrayList.get(ArrayList.java:321)                                                              
       at com.atlassian.bamboo.plugins.checkstyle.CheckStyleReportParser.convertTopViolationsToCsv(CheckStyleReportParser.java:127)                             
       at com.atlassian.bamboo.plugins.checkstyle.CheckStyleBuildProcessor$CheckStyleFileVisitor.runParse(CheckStyleBuildProcessor.java:132)                    
       at com.atlassian.bamboo.plugins.checkstyle.CheckStyleBuildProcessor$CheckStyleFileVisitor.visitFile(CheckStyleBuildProcessor.java:121)                   
       at com.atlassian.bamboo.utils.FileVisitor.visitAlLFilesThatMatchAPattern(FileVisitor.java:78)                                                            
       at com.atlassian.bamboo.utils.FileVisitor.visitFilesThatMatch(FileVisitor.java:52)                                                              
       at com.atlassian.bamboo.plugins.checkstyle.CheckStyleBuildProcessor.run(CheckStyleBuildProcessor.java:77)                                                
       at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.performCustomBuildProcess(ExecuteBuildTask.java:97)                                        
       at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:50)                                                             
       at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)                                                              
       at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)                                              
       at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)                                             
       at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$1.run(NamedThreadFactory.java:31)                                                   
       at edu.emory.mathcs.backport.java.util.concurrent.helpers.ThreadHelpers$1.run(ThreadHelpers.java:34)                                                     
       at java.lang.Thread.run(Thread.java:595)

    1. Hey I was just going to report that issue! Easy fix for the developers though.

  4. Don't know where to post this bug, but there are issues (NumberFormatException), when you try to generate statistics, while the checkstyle plugin is active. (Unfortunately this effects all statistics - not only the checkstyle statistics).

    These only happen under (for instance) a german locale.

    To fix go to CheckstyleIndexReader.addBuildToSummary(..) and change the line:

    double violations = Double.parseDouble(s);

    to

    double violations = NumberUtils.stringToDouble(s);

    This is needed because in the PostBuildIndexWriter the NumberUtils.padWithZeros(..)-method is used, which respects the current locale (and generates strings like "000001234,00"). A simple Double.parse() thus is not enough.

  5. Hi all,
    sorry for the delay, but I've just fixed the 2 reported bugs.
    Cheers

  6. The aggregated per plan data is inaccurate. We have a multi-module project that results in 10 individual checkstyle.xml report files being generated by checkstyle itself as part of the build, of which there were at least 500+ warning and 1000+ info level violations. However the plugin reports 0 warnings, 0 info. I have not as yet delved into the code but i presume the plugin's functional tests cover converging/aggregating executions?.

    Note the bamboo log file shows that the plugin processed each file so our glob wasnt incorrect.

  7. Stephan, Is there anyway you could add a table below the graph showing the number of checkstyles for each build that showed what the actual checkstyle errors are ? It is kind of hard to tell what to fix just from looking at the top violators. Or does this capability already exist somewhere in the plugin ?

  8. I'm finding two problems with the way this plugin is working:

    • It seems to require a path to the results file itself, not to the directory it is in. Like some of the comments above, I can get it to work if I use **/target/checkstyle-result.xml, but not if I use **/target or **/target/* or **/target/*.xml.
    • It does not seem to aggregate the data from Maven multi-module builds, but rather takes the checkstyle-result.xml from that last module in the chain.

    We are running Bamboo 1.2.4, with Maven 2.0.8, and our project set up as multiple Maven modules.

    Thanks for any hints,
    John

  9. Hi Paulick!

    is any update scheduled to support Bamboo v2???

    Thanks in advance,

    Fernando

  10. Also interested in a Bamboo 2 compatible plugin with the issues regarding the non aggregation of maven multi module builds resolved, is this planned?

  11. We also need a working version for Bamboo 2 ... anyone working on it?

  12. I am currently using Bamboo 2 when i try using the checkstyle(bamboo-checkstyle-plugin-1.0.1.jar )Plugin ,it seems checkstyle doesnt works with the bamboo 2 .Can you give me some suggestion to get checkstyle working with bamboo2 !!!

  13. Hi all,

    I posted a Bamboo 2.0 snapshot version of this plugin : bamboo-checkstyle-plugin-2.0-RC1-SNAPSHOT.jar
    I'm testing it this week and I'm thinking release it the next week.

    Good testing (wink)

    1. S

      It's excellant to see the plugin being maintained...

      After upgrading to the snapshot jar I'm not seeing anything in the delta column - is this to be expected?

  14. I see a change history for 2.0, but the download link still points at 2.0-beta1

    Is there a 2.0 jar available?

  15. Sorry, but not yet.
    I will test the 2.0-SNAPSHOT with Bamboo 2.1, and I will release it.

    Cheer,
    Lilians

    PS: Sorry for the late, but I have just returned from vacation.

  16. Hi,

     When running v2.0 of this plugin on Bamboo 2.1 I get the following exception:

    2008-08-12 11:09:12,755 WARN [BAM::gbrndd08.chp.co.uk::Agent] [ExecuteBuildTask] Failed to execute plugin with classclass com.atlassian.bamboo.plugins.checkstyle.CheckStyleBuildProcessor : MLS-MLQTE-33
    java.lang.ArrayIndexOutOfBoundsException: 1
        at com.atlassian.bamboo.plugins.checkstyle.CheckstylePluginHelper.convertFilenameInHttpURL(CheckstylePluginHelper.java:189)
        at com.atlassian.bamboo.plugins.checkstyle.CheckstylePluginHelper.transformFilenameInHttpURL(CheckstylePluginHelper.java:160)
        at com.atlassian.bamboo.plugins.checkstyle.CheckstylePluginHelper.transformFilenameInHttpURL(CheckstylePluginHelper.java:141)
        at com.atlassian.bamboo.plugins.checkstyle.CheckStyleBuildProcessor.call(CheckStyleBuildProcessor.java:60)
        at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.performCustomBuildProcess(ExecuteBuildTask.java:109)
        at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:69)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:192)
        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:89)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:105)
        at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$1.run(NamedThreadFactory.java:32)
        at edu.emory.mathcs.backport.java.util.concurrent.helpers.ThreadHelpers$1.run(ThreadHelpers.java:34)
        at java.lang.Thread.run(Unknown Source)

    Plus it although it saves the path I enter for the check-style report if I edit the build plan, it reverts to **/target/checkstyle-report.xml rather than the one I previously entered.

    Thanks,
    Pete 

    1. Hi,

      Which is the value of your Base HTML Site URL ?

      For the second problem, I have created the http://developer.atlassian.com/jira/browse/BCHKSTYL-14.

      Cheers,
      Lilians

      1. I ran into the same problem. The bug is that in CheckStyleBuildProcessor.call the function CheckstylePluginHelper.transformFilenameInHttpURL is called even if no Site URL is set.

        The fix is to add a check before this line like this:

          if (StringUtils.isNotBlank( customConfiguration.get( CHECKSTYLE_SITE_URL )))
                  CheckstylePluginHelper.transformFilenameInHttpURL( sourceDirectory, customConfiguration, checkstyleResults );

      2. I also noticed that

        http://developer.atlassian.com/jira/browse/BCHKSTYL-14

        is a side effect from the missing CHECKSTYLE_SITE_URL check. After I added the if-check it is now working.

        1. Thanks for reply.
          I have released the 2.1 version with this bugs fixing.

          Lilians

  17. Hi,

    with Bamboo 2.3 we get the error

    Failed to execute plugin 'CheckStyle Result Collector' with error: com.atlassian.bamboo.v2.build.BuildPlanDefinition.getRepository()Lcom/atlassian/bamboo/v2/build/repository/RepositoryV2;
    

    Thomas

  18. I adapted the code to Bamboo 2.3.1. If someone can give me write access to the repository I would like to check it in.

  19. Is there any update on an official release that supports 2.3.1?

    thanks