Question

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?

Was it helpful?

Solution 2

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

OTHER TIPS

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top