Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven Aggregated site generation

I have a maven based project. There are four different projects like shown in the structure below. Each main project and the subprojects have their own pom.xml files.

ProjectA
    |
    --------subProjects     
ProjectB  
   |
   --------subprojects
ProjectC    
   |
   --------subProjects
ProjectD
   |
    -------subprojects

I am running mvn site on ProjectC which is dependent on ProjectB which is inter-dependent on ProjectA and ProjectB

So when i run maven site all the test results for all these projects get created individually. What I would also like to do is to create a aggregation of all the test results in these projects and sub-projects and show it in one place.

So is it possible with maven site?

like image 554
Sam Avatar asked Feb 08 '13 07:02

Sam


2 Answers

A bit different approach would be to see test results in specialized servers like Jenkins or Sonar. This way no need to modify existing projects.

See running examples at https://builds.apache.org/ and https://analysis.apache.org/

Two screenshot from Sonar: Test results

Result by module and package Test results by module & package

For Jenkins there is Dashboard View Plugin enter image description here

like image 40
Paul Verest Avatar answered Sep 17 '22 17:09

Paul Verest


Yes. There are two options:

  1. "You can do this by setting project.build.directory on all of your projects to a common folder."

  2. You can add extra directories to the maven-surefire-report-plugin by adding an reportsDirectories element with reportsDirectory children (documentation).

So this should work:

<reportsDirectories>
    <reportsDirectory>../ProjectA/target/surefire-reports</reportsDirectory>
    <reportsDirectory>../ProjectA/module1/target/surefire-reports</reportsDirectory>
    ...
</reportsDirectories>
like image 68
Aaron Digulla Avatar answered Sep 19 '22 17:09

Aaron Digulla