Maven Site, Sonar or both of them ?

by freddy mallet|

    As we get more and more questions about possible overlaps between Sonar and Maven Site, I think it is time to explain the clear vision we have on this important subject. Let me start by answering three questions :

    • What is the Maven Site made for ?

      Provide a static portal to publish documentation on projects. By the way, this portal is used by many Open Source projects as their main web site (for instance Commons Collections or Cargo).

    • What is Sonar made for ?

      Provide an enterprise OSS capable of handling, managing and reporting all data related to source code quality

    • What are the possible overlaps?

      All the quality reports available in the Maven Site under "Project Documentation -> Project Reports", such as CPD Report, PMD Report, Cobertura Tests Coverage, ...

    Having answered those questions, it seems pretty natural to replace the quality reports in the Maven Site by a link to the Sonar project page (permalink). By doing so, you naturally take advantage of Sonar capabilities :

    • No need anymore to configure each report in the pom.xml file, Sonar will handle that when launching the maven goal
    • Manage the quality profiles in a central place (the Sonar web site) and provide a ready to use code quality policy shared among your enterprise to any new project
    • Benefit from the historisation mechanism built in Sonar to see how your projects evolve over time.
    • Benefit from all level of aggregations provided by Sonar and stop switching from one report to another to know exactly what should be done on a project, a module, a package or a class.
    • Last but not least, have a consolidated view on all projects through the Sonar home page, which does not have an equivalent in Maven Site.

    In a nutshell, Maven Site is based on a document production model which is not suitable to manage, combine, historize and aggregate source code quality information : that is Sonar's job ! To avoid the overlap, simply reference the Sonarized projects in the Maven Site.