-
I am using SonarQube Developer Edition version 9.9.0.65466
-
I have one github repository with multiple solutions (.sln), I need to have separate reports and SonarQube projects for all of them. What is the recommended way of doing so?
Hi,
Welcome to the community!
How does your repository compile?
For .NET analysis is tied to compilation, so the answer will depend on your compile. If you compile once for each solution (which I doubt, but you never know), then you’ll just wrap the build in the SonarScanner for .NET begin and end commands.
If you compile once for the whole repository, well… you’re not going to like the answer. As I said, analysis is tied to the build, so I believe that getting one analysis per solution means compiling once per solution, with the compile wrapped in the begin and end commands, plus additional configuration to exclude the files you don’t want included in that particular analysis.
HTH,
Ann
In my repo each project occupies its own directory within the repository and each is independently buildable and deployable. I have found something in SonarCloud which suites in my case: Monorepo Support | SonarCloud Docs and would like to know whether SonarQube supports it or not? And how something like this can be implemented in SonarQube?
Thanks in advance.
Hi,
Monorepo support in SonarQube starts in Enterprise Edition($$). It gives you support for PR decoration in a monorepo. The docs should help.
Ann
This is what I did, maybe others will need the solution as well.
I manually created as many projects as needed, copied the project keys and created Teamcity jobs for those projects which starts sonar scanner, builds the specific solution and ends sonar scanner. And in each job I specified project key of specific SonarQube project where it pushes the report after the scan. So this solution worked in my case.
Hi,
I’m glad you got it worked out, and thanks for the followup.
Ann