I had no luck with the officially documented sonar.skip
: when I set it in a submodule POM, I saw
[INFO] Delaying SonarQube Scanner to the end of multi-module project
after modules which should have been included and then
[INFO] sonar.skip = true: Skipping analysis
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 that
Project '…' can't have 2 modules with the following key: …
which I fixed by moving this to .mvn/maven.config
:
-Dsonar.projectKey=…