Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarQube: How to analyze projects that share multiple modules?

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?

like image 451
Enrique Avatar asked Nov 23 '25 18:11

Enrique


1 Answers

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>
like image 133
Thomas Dills Avatar answered Nov 26 '25 11:11

Thomas Dills