import.css=^tan_deck.css
Name |
CheckStyle plugin |
---|---|
Version |
2.2 |
Product Versions |
2.0.x and Higher |
Author(s) |
|
Maintainer(s) |
|
Homepage |
http://confluence.atlassian.com/display/BAMEXT/CheckStyle+Plugin |
Price |
Free |
License |
|
IssueTracking |
|
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 |
Description/Features
A plugin that will parse and record CheckStyle reports
Usage
- 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.
- 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.
- New in version 2.2, You can configure an error or warning threshold which fail the build when checkstyle error/warnings exceed it
- 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 |
|
|
|
|
|
|
|
= compatible
= not compatible
= compatibility unknown
Version History
Version |
Date |
Description |
---|---|---|
May 18th 2008 |
Applied patch by Nicky Sandhu BCHKSTYL-16 : Fail build when checkstyle error/warnings exceed a threshold |
|
September 9th 2008 |
Bugs fixing, see below |
|
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 |
|
Jully 4th 2008 |
Bamboo 2.0 migration |
|
1.0.0 |
August 30th 2007 |
initial version |
1.0.1 |
October 29th 2007 |
fix reported bugs |
2.3
2.2
2.1
2.0
Fix of version Bamboo 2.0-beta1
Screenshots
Screenshots |
||
---|---|---|
30 Comments
Peter Johnstone
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?.
Stephan Paulicke
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).
Peter Johnstone
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
Janusz Gorycki
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 justtarget
Sebastian Voigt
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
Stephan Paulicke
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
Maarten Moens
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)
John Allen
Hey I was just going to report that issue! Easy fix for the developers though.
Stefan Hansel
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.
Stephan Paulicke
Hi all,
sorry for the delay, but I've just fixed the 2 reported bugs.
Cheers
John Allen
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.
Eric Geordi
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 ?
John Brugge
I'm finding two problems with the way this plugin is working:
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
Fernando Silva
Hi Paulick!
is any update scheduled to support Bamboo v2???
Thanks in advance,
Fernando
Alan M
Also interested in a Bamboo 2 compatible plugin with the issues regarding the non aggregation of maven multi module builds resolved, is this planned?
Max Horváth
We also need a working version for Bamboo 2 ... anyone working on it?
Sreehary V Kalichamy
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 !!!
Auvigne Lilians
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
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?
Auvigne Lilians
No, I don't think.
I created this issue : http://developer.atlassian.com/jira/browse/BCHKSTYL-4
Kevin Behrens
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?
Auvigne Lilians
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.
Peter Hannam
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
Auvigne Lilians
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
Jürgen Moßgraber
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 );
Jürgen Moßgraber
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.
Auvigne Lilians
Thanks for reply.
I have released the 2.1 version with this bugs fixing.
Lilians
Thomas Landgraf
Hi,
with Bamboo 2.3 we get the error
Thomas
Jürgen Moßgraber
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.
Jan Swaelens
Is there any update on an official release that supports 2.3.1?
thanks