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.?
I had no luck with the officially documented
sonar.skip
: when I set it in a submodule POM, I sawafter modules which should have been included and then
at the end of the reactor build, and there was no analysis/upload.
Instead I defined
sonar.exclusions
in the root POM to a pattern matching the source files (by package path) which would be used in the submodule to be skipped. This seems to have worked.As an aside, setting
sonar.projectKey
in the root POM did not work; Sonar complained thatwhich I fixed by moving this to
.mvn/maven.config
:There are several ways, one of which is adding the
sonar.skip
property inside thepom.xml
of the project / module you want to skip.This excludes a project from SonarQube analysis:
This also works with Jenkins and running Sonar as a post build action.
For more details see: Analyzing with SonarQube Scanner for Maven
From the documentation, there is an option to skip module using
sonar.skippedModules
You could also do this from the sonar admin page as documented in the Skipping Modules section here.