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