No violations will be created by running an analysis, external reports must be created first. See Generate Generating Violations Reports for Supported Tools
You can analyze your projects using the usual means (see this page for all available). All runners should work. See below for details how to do it for maven-, ant-, and all-the-other-projects.
Running a SonarQube analysis on maven projects is quite simple and usually a matter of:
- Getting and installing the cxx-maven-plugin (usage).
- Setting the language - property and the source directory in your pom:
<properties> ... <sonar.language>c++</sonar.language> ... </properties> <build> ... <sourceDirectory> path </sourceDirectory> ... </build>
- Make sure sonar-your SonarQube server is running.
Start the analysis with with
"mvn sonarmvn sonar:sonar" or "mvn sonarmvn sonar:sonar sonar -Dsonar.phase=cxx:addsource"
For details see the first sample project.
Project using miscellaneous build systems
Outside of the maven world the process of integration of a sonar SonarQube analysis into your project is usually less straightforward but also more flexible. The rough pattern should remain the same independent of the environment:
- Run the analyzers which are of interest for you and store the results in a file somewhere underneath the root directory of your project. Its usually convenient to put this into the build system; a shell script may be a good choice, too.
Use the sonar-runner SonarQubeRunner to trigger the Cxx plugin which parses the result files and feeds the data into sonarSonarQube. The sonar runner SonarQubeRunner requires some data to proceed which is usually provided via the "sonar-project.properties"- file in the projects project root directory.
There may be a Step '0' too: "use your build system to make a build suitable for running the Step 1". This may be the case for collecting coverage statistics when using gcc+gcov, for example.