How to exclude some maven project from sonar analysis

Sumit Singh picture Sumit Singh · Apr 10, 2014 · Viewed 33.2k times · Source

I have many(Let say 10 (A, B, C...)) eclipse plugin which is maven based.

I have one master pom file which includes all other plugin projects. now by building master file with sonar:sonar goal it will build all the plugins.

So my question: Is there is any way so that I can exclude some plugin let say A and C.?

Answer

Cryn picture Cryn · Nov 5, 2015

There are several ways, one of which is adding the sonar.skip property inside the pom.xml of the project / module you want to skip.

This excludes a project from SonarQube analysis:

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

This also works with Jenkins and running Sonar as a post build action.

For more details see: Analyzing with SonarQube Scanner for Maven