Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

My team (~10 devs) has recently migrated to Maven (multi-module project, ca. 50 modules) and we now use Jenkins for continuous integration. As the overall setup is running, we are planning to include code analysis and reporting tools (e.g., Checkstyle and Corbertura).

As far as I can see, we basically have two options to generate such reports: either use Maven's reporting plug-ins to generate a site and/or use Jenkins plug-ins to do the reporting.

Which approach is better, and for which reasons?

It seems both have their merits:

Maven-Reporting:

  • everything is configured in a single place (the pom files)
  • report generation on a local machine (i.e., without Jenkins) is straightforward and does not require any additional steps

    Jenkins-Reporting:

  • adjusting the reporting configuration seems more intuitive than with Maven and does not interfere with the main task of maven in our setup (building and deploying)
  • a single web-interface to check the overall status of the project, so that the reported issues are easier to find and harder to ignore (i.e., no need to click through the maven site, some nice history plots, notifications, etc.)

    Has anyone made a similar decision in the past, or is this a non-issue for some reason? (How well does it work? Any regrets?)

    Is it advisable to go both ways, or is that setup too tedious to maintain?

    Are there aspects of the problem that I am unaware of, or some advantages I have not noticed (e.g., is Maven-based reporting integrated nicely with m2eclipse)?

    Any pitfalls or typical problems that we are likely to encounter?

    EDIT:

    We tried out Sonar, as suggested below (including its Jenkins plug-in). So far, it works pretty well. Sonar is relatively simple to install and works on top of our Maven setup (one just invokes mvn sonar:sonar or re-configures a Jenkins job, that's all). This means we do not have to maintain a duplicate configuration, as all our Maven settings are used automatically (the only exception being exclude patterns). The web-interface is nice, and -- even better -- there is an Eclipse plug-in that retrieves all issues automatically, so that no one really has to browse to the Sonar website, as all issues can be automatically displayed in the IDE.

  • share|improve this question
    1  
    Jenkins has previously been very hard to backup properly. Might be better now. –  user1249 Sep 27 '11 at 8:42

    1 Answer 1

    up vote 9 down vote accepted

    Since you already have your projects ready for Maven and Jenkins is installed, you may go one step further and install Sonar. It is an incredible code quality related tool, it performs Cobertura, Checkstyle, FindBug, and many other analysis tools at the same time. That way, the code quality reporting is done by Sonar, not by Maven or Jenkins.

    You can install Sonar on the same machine where Jenkins is installed or somewhere else. If you just want to test it, you can just perform the standard install (it uses its own HSQLDB if you don't configure the database yourself) and you are almost ready to go. The last thing you need is to configure the relationship between Jenkins and Sonar.

    There is done via the Sonar plugin for Jenkins. Once you have installed the plugin:

    1. Indicate where Sonar can be located on the Jenkins configuration
    2. For each build job you want to be analysed, go into the job configuration and check the "Sonar" checkbox.

    Be careful for one thing: the analysis may be quite long for big projects. But then again, you may configure special nightly Sonar builds in addition to standard builds.

    Hope that helped.

    share|improve this answer
        
    Thank you for pointing me to this tool --- still, I think I would prefer to solve the issue with one of the tools we already have installed, i.e. Maven or Jenkins (Sonar would be yet another tool to administer, backing up, showing people how to use it, etc.). Anyway, it sounds interesting, I'll definitely give it a spin on a local machine! :) –  Roland Ewald Sep 27 '11 at 19:40

    Your Answer

     
    discard

    By posting your answer, you agree to the privacy policy and terms of service.

    Not the answer you're looking for? Browse other questions tagged or ask your own question.