Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
SonarQube
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Critical" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9Q3JpdGljYWx9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>No violations will be created by running an analysis, external reports must be created first. See <a class="confluence-link" href="/display/SONAR/Generating+Violations+Reports+for+Supported+Tools" data-linked-resource-id="230398141" data-linked-resource-type="page" data-linked-resource-default-alias="Generating Violations Reports for Supported Tools" data-base-url="http://docs.codehaus.org">Generating Violations Reports for Supported Tools</a></p></td></tr></table><h1>Usage</h1><p>You can analyze your projects using the usual means (see <a href="http://docs.codehaus.org/display/SONAR/Installing+and+Configuring+Sonar+Runner">this</a> page for all available). All runners should work. See below for details how to do it for maven-, ant-, and all-the-other-projects.</p><h2>Maven Projects</h2><p>Running a SonarQube analysis on maven projects is quite simple and usually a matter of:</p><ul><li>Getting and installing the <a href="https://github.com/franckbonin/cxx-maven-plugin">cxx-maven-plugin</a> (<a href="https://github.com/franckbonin/cxx-maven-plugin/wiki/Introduction">usage</a>).<br /><ul><li>if you use multiple source directory and depend on <a href="http://franckbonin.github.com/cxx-maven-plugin/addsource-mojo.html">cxx:addsource</a> goal, you shall use -Dsonar.phase=cxx:addsource option (see <a href="http://docs.codehaus.org/display/SONAR/Analysis+Parameters">Sonar Maven Plugin Project Configuration</a>)</li></ul></li><li>Setting the language property and the source directory in your pom:<p> </p><table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><properties> ... <sonar.language>c++</sonar.language> ... </properties> <build> ... <sourceDirectory> path </sourceDirectory> ... </build></pre></td></tr></table></li><li class="line number1 index0 alt2">Make sure your SonarQube server is running.</li><li><p>Start the analysis with <code>"mvn sonar:sonar" or "mvn sonar:sonar -Dsonar.phase=cxx:addsource"</code></p></li></ul><p>For details see the <a href="https://github.com/SonarCommunity/sonar-cxx/tree/master/src/samples/SampleProject">first sample project</a>.</p><h2>Project using miscellaneous build systems</h2><p>Outside of the maven world the process of integration of a SonarQube analysis into your project is usually less straightforward but also more flexible. The rough pattern should remain the same independent of the environment:</p><ol><li>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.</li><li><p>Use the SonarQubeRunner to trigger the Cxx plugin which parses the result files and feeds the data into SonarQube. The SonarQubeRunner requires some data to proceed which is usually provided via the <em>sonar-project.properties</em> file in the project root directory.</p></li></ol><p>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.</p><p>For details how to invoke the tools and tie it all together see the <a href="https://github.com/SonarCommunity/sonar-cxx/tree/master/src/samples/SampleProject2">second sample project</a>.</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced