Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to skip a sub module in a sonar analysis in a multi module java project

I have a multi module Maven project. I need to exclude one of the sub module from sonar anlaysis.

I run the mvn sonar:sonar from parent directory.

Is there a way to specify the exclusions in pom file or do we need to configure it in sonar qube.

like image 942
sivachithambaram rangaraj Avatar asked May 11 '15 22:05

sivachithambaram rangaraj


1 Answers

From the documentation:

You can either:

  • define property <sonar.skip>true</sonar.skip> in the pom.xml of the module you want to exclude
  • use build profiles to exclude some module (like for integration tests)
  • use Advanced Reactor Options (such as "-pl"). For example } mvn sonar:sonar -pl !module2
like image 134
David RACODON - QA Consultant Avatar answered Oct 01 '22 21:10

David RACODON - QA Consultant