Need help/example for setting up FindBugs and CheckStyle

I'm setting up a sample Java project right now and I'm trying to figure out how to setup my Ant tasks/build runners to make FindBugs and CheckStyle work. As best I can tell, there are no examples that tell me where I should drop the Ant JARs, how I should configure environment variables, and--most importanly--what a common, default configuration of the Ant task should look like to get these items to work within the TeamCity environment. I see that the live demo project has build configurations for each of these targets. Is there any chance you might share the underlying build.xml files you used for these? That would provide me with a starting point. I know that this isn't particularly complex, but I'm still struggling with the configuration settings to get TeamCity to sucessfully run and generate reports for each of these tools. Any help would be greatly appreciated.

5 comments
Comment actions Permalink

TeamCity simply starts Ant with provided build.xml and nothing more. There should not be differences when you start build.xml manually or when it is started by TeamCity agent. Do you have some TeamCity specific issues with your build.xml?

0
Comment actions Permalink

Thanks for your reply. While it's true that *running* these tools as part of the build is more a matter of creating the ant tasks and following the documentation for each individual tool, getting the tool to feedback output into the application is not. I think it's probably a few trivial steps, but there's still nothing out here that tells me where I should send the output and how best to bring that output back into the application. You do all that for me with JUnit, but it's not clear what I'm supposed to do for other tools like these.

On a spearate note, it's also not clear how I should structure my dependencies for JUnit. Should I be re-compiling the application for this step or can JUnit depend on the compile build configuration and use its output to run the tests (preventing the build from compiling twice). If this is the preferred model, can this be made to work with the default TeamCity output directories or will I need to point the build at my own directories.

I know the real answer here is "it depends what you want to do" and I know there are many ways to achieve this. However, it would be nice to have some example of how JetBrains did it in its live demo to see how I might want to incorporate this into my own configuration. Right now, I have no sample Ant scripts that show me how at least one scenario where someone has created a project that compile java, runs JUnit, runs FindBugs, and runs CheckStyle. You creates just such a project, but I can't see the Ant scripts or view the build configuration to get a sense for what I might want to consider in my own solution.

Assuming I can't get access to this example, can someone help me answer the following questions:

1) How should I configure my JUnit dependencies to prevent the need to recompile before running the tests? Is that a common practice with TeamCity?
2) Where should I put the output of FindBugs and how do I configure my build configuration to import this output?
3) Where should I put the output of CheckStyle and how do I configure my build configuration to import this output?

0
Comment actions Permalink

1) Common practice is to always compile your code before running tests, the whole sequence should be:
- clean all classes and reports produced by the build
- compile
- run tests

Clean should not be placed after tests because JVM may crash or build can be killed and clean will not be done

2) TeamCity accepts FindBugs reports in xml format, report can be generated into any directory,path to this directory should be specified at the build configuration runner setting (see XML Report Processing section)

3) Checkstyle is not directly supported but you can generate HTML report and publish it as TeamCity artifact, then follow these instructions on how to setup custom tab with this report shown: http://www.jetbrains.net/confluence/display/TCD4/Including+Third-Party+Reports+in+the+Build+Results

0
Comment actions Permalink

Is anyone at Jetbrains responsible for monitoring and actively answering questions on your boards? I've posted a few questions out there that and it seems like some items are simply ignored. I know that I'm not a "paying customer" yet, but I'm still using my experience on the boards to help me understand whether I can get good, responsive support when I run into issues. Right now, it feels like these boards offer marginal value and that the community is largely inactive (with the exception of a few key threads). I don't mean to complain, but I'm not sure I understand what I should expect in terms of support at this point. I just know that I posted a separate "support is slow here" thread weeks ago that remains unanswered. I thought, by posted directly to you on this thread, I might have some hope of understanding where I can get better answers to my questions.

0
Comment actions Permalink

Seems that here is a strange case when CS plugin ( in TS 6 EAP) could not be used with PMD and PMD CPD types in same build why such limitations exists?
P.S. Sorry for necroposting again.

0

Please sign in to leave a comment.