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

1

18

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.

Exhibit answered 11/5, 2015 at 22:20 Comment(1)
I see sonar.skipmodule options are depricated in latest version.Exhibit
S
22

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
Scornik answered 15/5, 2015 at 14:24 Comment(3)
Only linking some documentation is not that helpful. Especially as in this case the page does not exist anymore. I would suggest to paste the important part and add the link for additional info.Longawa
I updated the answer with the up-to-date link and also quoted the relevant part from the documentation.Rhizocarpous
Link to documentation is brokenHomophony

© 2022 - 2024 — McMap. All rights reserved.