2
votes

I have a question regarding sonar analysis with maven.

I have a group of projects built by maven, and a handy pom files to aggregate the projects together, so that I can run one maven build for all projects.

I also would like to run sonar analysis against the aggregated pom. The analysis is done without errors, the only problem is the aggregated result: even though I run the analysis against the aggregated pom, I would like to get individual analysis result for each projects instead an aggregated report. Is there any configuration/argument to achieve this?

Thanks a lot.

1
AFAIK, we can drill-down to each module by using the sonar project dashboard. It's just clicking at the Components menu at the left hand side menu. - Charlee Chitsuk
Hi Charlee, Thanks for quick response. I checked my sonar and found out my projects can be seen as "sub project" now. Question is the alerts in quality profiles I set for projects do not apply to sub projects, and there is no warnings available for sub project dashboard. Any suggestion? - Skywolf
Have you tried to add some wigets to the sub project dashboard? e.g. Rules Compliance, Useless Code - Charlee Chitsuk

1 Answers

0
votes

No, this can be achieved the way you're doing it. And you would advise you not to continue in this direction, as creating an "aggregator POM" is a just a workaround which has many side effects in Sonar.

The correct way to achieve what you want is to analyse each project independently and to create views & sub-views to aggregate all the information the way you want. For this, you need the Views Plugin.