Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude some maven project from sonar analysis

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.?

like image 300
Sumit Singh Avatar asked Apr 10 '14 07:04

Sumit Singh


People also ask

How do I exclude a project from SonarQube?

To use exclusions to analyze only the specified subset(s) of files in sonar. sources , go to Project Settings > General Settings > Analysis Scope > Files. You can set these properties at both the project and global levels.


1 Answers

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

like image 191
Cryn Avatar answered Sep 18 '22 16:09

Cryn