How to combine SonarQube results from multiple targets

SonarQube ver. 8.8 and SonarScanner ver. 4.6

We are attempting to use SonarQube/Scanner to scan multiple build targets in a single project, however it overwrites the results from the previous target with the new results. How do you combine scans from multiple targets into a single scan output?

Looking through the forums I saw some mention of it being done utilizing Jenkins, however there is no detailed information on how to actually aggregate the results from each target.

Hi,

Welcome to the community!

I believe you’re looking for Applications, which is available starting in Developer Edition($). I.E. you’re going to analyze each target into a separate project and then re-combine them into a synthetic project, i.e. Application.

 
HTH,
Ann

Hey Ann,

Thanks for the quick reply. Let me give a bit more detail. We are using Atlassian Bamboo to run SonarQube/Scan on each Pull Request for a project that contains multiple .sln files within one repository. I looked through the documentation you linked for Applications and not sure how it would work with the automated pull request implementation.

Here is a generalized image of the process as well from our initial implementation.
image

Hi,

I think you want to change your build process to this:

cd source
git checkout foobar
SonarScan begin /k:"A" ...
Wrapper MSBuild A\A.sln
SonarScan end

SonarScan begin /k:"B" ...
Wrapper MSBuild B\B.sln
SonarScan end

That’s for a general project build. If we’re talking about a single PR with multiple builds in it (which is what you show) then I guess you’re looking for monorepo support, which starts in Enterprise Edition($$).

 
HTH,
Ann

Hey Ann,

The monorepo support looks like it is what we are looking for. We have DataCenter edition which includes this. Thank you very much for the info!

1 Like