cynepnaxa cynepnaxa - 1 year ago 125
Java Question

Sonar: "Module is already part of project" or How to upload projects with same dependencies?

I have two projects (A and B), which use the same reusable module (C). I upload A into sonarqube without problems, but when I upload B, the sonar-maven-plugin tells me that Module C is already part of project A. How can I fix it? I want both of my projects to be uploaded into sonarqube.

Answer Source

I just had this problem as well. If you are running a newer version of Maven, you can exclude modules. This may or may not be a sufficient answer for you, but it was for me.

When you run Sonar on project A, run it normally (no --projects switch). When you run Sonar on project B, supply an exclusion list (with the --projects switch).

For Project A:

mvn sonar:sonar


mvn sonar:sonar --projects !moduleC

This method is mentioned briefly here:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download