SonarQube: How to analyze projects that share multiple modules?

sonar maven multi-module project
sonarqube multi module project
sonarqube multi module gradle
sonar properties
sonar.sources multiple directories
sonar-project properties
sonar gradle multi-module project
sonar-maven-plugin

I have four projects, which have several modules in common.

When I try to run a SonarQube complete analysis, only the first project gets successfully analyzed. Starting with the second project, I get an error message along the lines of "XXX module is already present in the server".

Each of my four projects contains an aggregator POM. This is what I use to build them and to run the Maven sonar:sonar goal.

What would be the best approach to solve this issue?


It seems you're breaking component/module/library conventions or mis used it. From Configuration Management principles you're not supposed to "include" (build in the case of Binary Configuration Management) your component multiple times.

Having a library which have many other ones which depends on and last ones are independant is just a dependancy that you have to manage appart like any other framework.

You're just supposed to install/deploy this component on his own and then just refer to it. Same principles apply on SonarQube Configuration Manager. You can't have shared components analyzed through different "products".

They must have their own life cycle. How do you manage evolution of shared librairies when having the four projects living in parallel of each others ?

Analyzing with SonarQube Scanner - Scanners, You'll find them filed under projects/languages. Multi-module Project. There are two ways to define a multi-module  I want to integrate multiple projects in sonarqube(Not multiple modules). Is it possible to integrate multiple projects in sonarqube? When I used multiple comma-separated sources in sonar.sources attribute of sonar-project.properties file, I got an aggregated report.


Select a master project in which to analyze the shared modules; analyze that project first.

In the other (subsequent) projects, exclude the shared modules from SonarQube analysis by adding the following to the pom.xml of the shared modules:

<properties>
    <sonar.skip>true</sonar.skip>
</properties>

Appendix B. Analysis - SonarQube in Action, In this appendix, we'll show you how to run a SonarQube analysis via three file: /usr/share/sonarRunner/conf/sonar- runner.properties Project configuration file: If you're dealing with a multi-module project, you need to set up the properties  which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) version - 6.7.7 what are you trying to achieve We want to configure SonarQube for multi language project.


If by shared modules, you mean that the module is present in both Project A and Project B then yes, It will create a problem because SONAR only allows one instance of a Module to be present.

What you can do is run SONAR on your Project 1 then clear the workspace and again run it for Project 2.. and So on...

That way you would have only one instance of a module in SONAR at a time.

you can probably write a script for executing the SONAR jobs one by one and create a new job for that in Jenkins.

Creating an aggregated SonarQube report for multiple Maven projects, SonarQube neatly creates a project for each Maven artifact out of the box. and we use our Jenkins build jobs to send Sonar reports to the SonarQube server. pom file with the projects I want to aggregate on as sub-modules. it from SonarQube and then relaunch the analysis of project "com.foo:bar". Security. Any user who's granted Execute Analysis permission can run an analysis.. If the Anyone group is not granted Execute Analysis permission or if the SonarQube instance is secured (the sonar.forceAuthentication property is set to true), the credentials of a user having been granted Execute Analysis permission have to be provided through the sonar.login and sonar.password properties.


Does the Sonar for Stash work with multi-module projects?, com.mycompany.project.module1.submodule1. When running a sonar analysis from the repo root sonarqube assigns the following project keys  Your teammate for Code Quality and Security . SonarQube empowers all developers to write cleaner and safer code. Join an Open Community of more than 120k users


Sonar and Gradle Multi-Module Projects, One differentiator between the Sonar Plugin for Gradle and Maven is, that the Gradle version does not automatically run code coverage analysis. To detect duplications between the modules of your project and between the different projects analyzed on your SonarQube platform, log in as a a System administrator, go to Settings > General Settings > General > Duplications and set the Cross project duplication detection property to true. Then run another analysis on your projects.


Analyzing a Multi-Module Maven Project with SonarQube, Navigate into the folder depending on your current operating system, i.e. linux-​x86-64. Execute the sonar.sh script. Sonar should now startup. thanks for replying. It seems that I was wrong about the property itself. I have a different issue here: the properties are not read from sonar-project.properties (but I believe they were when I set the project up a few months ago (?)).