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
Sonar
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="icon=false|title=Table of Contents" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZXx0aXRsZT1UYWJsZSBvZiBDb250ZW50c30&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e3RvY30&locale=en_GB&version=2" data-macro-name="toc"></p></td></tr></table><p>Parameters to configure analysis of project can be set in various places in Sonar. Here is the hierarchy of parameters:</p><ul><li>Global analysis parameters, defined in the UI, will apply to all the projects</li><li>Project analysis parameters, defined in the UI, will override global parameters</li><li>Project analysis parameters, defined in project analysis configuration file or in analyzer configuration file, will override the ones defined in the UI</li><li>Command line parameters, defined when launching an analysis, will override project analysis parameters</li></ul><div><span>Note that only parameters set through the UI are stored in the database.</span></div><div><span>For example, if you set the 'sonar.profile' parameter via command line for a specific project, it will not be stored in the database. Then, a local analysis in Eclipse will be run against the default quality profile.</span></div><h1>Mandatory Parameters</h1><h2>Sonar Server</h2><table class="confluenceTable"><tbody><tr><th class="confluenceTh"><p>Key</p></th><th class="confluenceTh"><p>Description</p></th><th class="confluenceTh"><p>Default value</p></th></tr><tr><td class="confluenceTd">sonar.host.url</td><td class="confluenceTd">Sonar server URL</td><td class="confluenceTd"><a href="http://localhost:9000/">http://localhost:9000</a></td></tr></tbody></table><h2>Database</h2><table class="confluenceTable"><tbody><tr><th class="confluenceTh"><p>Key</p></th><th class="confluenceTh"><p>Description</p></th><th class="confluenceTh"><p>Default value</p></th></tr><tr><td class="confluenceTd"><p>sonar.jdbc.driverClassName </p></td><td class="confluenceTd"><p>JDBC Driver used by Sonar</p></td><td class="confluenceTd"><p>org.h2.Driver</p><p>Prior to Sonar 3.2: org.apache.derby.jdbc.ClientDriver</p></td></tr><tr><td class="confluenceTd"><p>sonar.jdbc.url</p></td><td class="confluenceTd"><p>JDBC Connection URL</p></td><td class="confluenceTd"><p><a>jdbc:h2:tcp://localhost:9092/sonar</a></p><p>Prior to Sonar 3.2: <a>jdbc:derby://localhost:1527/sonar</a></p></td></tr><tr><td class="confluenceTd"><p>sonar.jdbc.username</p></td><td class="confluenceTd"><p>User for the JDBC Connection</p></td><td class="confluenceTd"><p>sonar</p></td></tr><tr><td class="confluenceTd"><p>sonar.jdbc.password</p></td><td class="confluenceTd"><p>Password for the JDBC Connection</p></td><td class="confluenceTd"><p>sonar</p></td></tr></tbody></table><h2>Project Configuration</h2><table class="confluenceTable"><tbody><tr><th class="confluenceTh"><p>Key</p></th><th class="confluenceTh"><p>Description</p></th><th class="confluenceTh"><p>Default value</p></th><th class="confluenceTh"><p>Version</p></th></tr><tr><td colspan="1" class="confluenceTd">sonar.projectKey</td><td colspan="1" class="confluenceTd"><p>The project key that is unique for each project.<br />Set through <groupId>:<artifactId> when using Maven.</p></td><td colspan="1" class="confluenceTd"> </td><td colspan="1" class="confluenceTd"> </td></tr><tr><td colspan="1" class="confluenceTd">sonar.projectName</td><td colspan="1" class="confluenceTd"><p>Name of the project that will be displayed on the web interface.<br />Set through <name> when using Maven.</p></td><td colspan="1" class="confluenceTd"> </td><td colspan="1" class="confluenceTd"> </td></tr><tr><td colspan="1" class="confluenceTd">sonar.projectVersion</td><td colspan="1" class="confluenceTd"><div class="container"><div class="line number1 index0 alt2">The project version.</div><div class="line number1 index0 alt2">Set through <version> when using Maven.</div></div></td><td colspan="1" class="confluenceTd"> </td><td colspan="1" class="confluenceTd"> </td></tr><tr><td class="confluenceTd"><p>sonar.language</p></td><td class="confluenceTd"><p>Sets the language of source code. If a Sonar plugin allows to analyze another language, the associated source code analyser can be activated with this property.<br />The default language can be set at instance level: go to Configuration > General Settings > General and set the sonar.language property. </p></td><td class="confluenceTd"><p>java</p></td><td class="confluenceTd"><p>since 2.0</p></td></tr><tr><td colspan="1" class="confluenceTd">sonar.sources</td><td colspan="1" class="confluenceTd"><p>Comma-separated paths to directories containing sources.<br />Not compatible with Maven: source code retrieved from default location for Java Maven projects. </p></td><td colspan="1" class="confluenceTd"> </td><td colspan="1" class="confluenceTd"> </td></tr></tbody></table><h1>Optional Parameters</h1><h2>Project Configuration</h2><table class="confluenceTable"><tbody><tr><th class="confluenceTh"><p>Key</p></th><th class="confluenceTh"><p>Description</p></th><th class="confluenceTh"><p>Default value</p></th><th class="confluenceTh"><p>Version</p></th></tr><tr><td colspan="1" class="confluenceTd">sonar.projectDescription</td><td colspan="1" class="confluenceTd"><p>Description of the project.<br />Set through <description> when using Maven. </p></td><td colspan="1" class="confluenceTd"> </td><td colspan="1" class="confluenceTd"> </td></tr><tr><td colspan="1" class="confluenceTd">sonar.binaries</td><td colspan="1" class="confluenceTd"><p>Comma-separated paths to directories containing binaries (in case of Java: directories with class files).<br />Not compatible with Maven: binaries retrieved from default location for Java Maven projects. </p></td><td colspan="1" class="confluenceTd"> </td><td colspan="1" class="confluenceTd"> </td></tr><tr><td colspan="1" class="confluenceTd">sonar.tests</td><td colspan="1" class="confluenceTd"><p>Comma-separated paths to directories containing tests.<br /><span>Not compatible with Maven: tests retrieved from default location for Java Maven projects. </span> </p></td><td colspan="1" class="confluenceTd"> </td><td colspan="1" class="confluenceTd"> </td></tr><tr><td colspan="1" class="confluenceTd">sonar.libraries</td><td colspan="1" class="confluenceTd"><p>Comma-separated paths to files with third-party libraries (in case of Java: JAR files). Pattern can be used.</p><p>Example:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="language=none" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9bm9uZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>sonar.libraries=path/to/specific/library/myLibrary.jar,path/to/library/*.jar</pre></td></tr></table><p>Note that * wildcard character is not supported for directories (only for files).</p></td><td colspan="1" class="confluenceTd"> </td><td colspan="1" class="confluenceTd"> </td></tr><tr><td colspan="1" class="confluenceTd"><p><img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e2FuY2hvcjpwYXJhbWV0ZXJTb3VyY2VFbmNvZGluZ30&locale=en_GB&version=2" data-macro-name="anchor" data-macro-default-parameter="parameterSourceEncoding">sonar.sourceEncoding</p></td><td colspan="1" class="confluenceTd"><p>Encoding of source files. Example of values: UTF-8, MacRoman, Shift_JIS. This property can be replaced by the standard property <em>project.build.sourceEncoding</em> in Maven projects.</p><p>The list of available encodings depends on your JVM. See <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html">http://docs.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html</a>.</p></td><td colspan="1" class="confluenceTd"><p>System encoding</p></td><td colspan="1" class="confluenceTd"> </td></tr><tr><td class="confluenceTd"><p>sonar.importSources</p></td><td class="confluenceTd"><p>Sometimes, for security or other reasons, project sources must not be stored and displayed.</p></td><td class="confluenceTd"><p>true</p></td><td class="confluenceTd"><p>since 1.5</p></td></tr><tr><td class="confluenceTd"><p><img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e2FuY2hvcjpwYXJhbWV0ZXJQcm9qZWN0RGF0ZX0&locale=en_GB&version=2" data-macro-name="anchor" data-macro-default-parameter="parameterProjectDate">sonar.projectDate</p></td><td class="confluenceTd"><p>It becomes quickly necessary to input historical data and to highlight some events. It is possible by going for example in a subversion tag and use the sonar.projectDate option. Format is yyyy-MM-dd, for example 2010-12-25.</p></td><td class="confluenceTd"><p>Current date</p></td><td class="confluenceTd"><p>since 1.5</p></td></tr><tr><td class="confluenceTd"><p>sonar.exclusions</p></td><td class="confluenceTd"><p>Exclude files from analysis. See <a class="confluence-link" href="/display/SONAR/Project+Administration#ProjectAdministration-ExcludingFiles" data-anchor="ExcludingFiles" data-linked-resource-id="135200864" data-linked-resource-type="page" data-linked-resource-default-alias="Project Administration#ExcludingFiles" data-base-url="http://docs.codehaus.org">Project Administration#ExcludingFiles</a> for more details. This page also details sonar.tests.exclusions, sonar.inclusions, sonar.tests.inclusions, sonar.global.exclusions, sonar.global.tests.exclusions.</p></td><td class="confluenceTd"><p> </p></td><td class="confluenceTd"><p> </p></td></tr><tr><td class="confluenceTd"><p>sonar.skippedModules</p></td><td class="confluenceTd"><p>Some project modules should not be analyzed and consolidated with global project measures, for instance samples, integration tests or generated code.<br />If a module's artifactId differs from its module name (the directory name) : it is the artifactId that should be use instead of the module name. Format is a comma-separated list of modules: module1_toexclude,module2_toexclude.</p></td><td class="confluenceTd"><p> </p></td><td class="confluenceTd"><p>since 1.5</p></td></tr><tr><td class="confluenceTd"><p>sonar.includedModules</p></td><td class="confluenceTd"><p>Comma-separated list of the modules to analyse, all other modules are automatically ignored. Be careful : the root project must be added to the list. <br class="atl-forced-newline" /> If a module's artifactId differs from its module name (the directory name) : it is the artifactId that should be use instead of the module name.</p></td><td class="confluenceTd"><p> </p></td><td class="confluenceTd"><p>since 2.2</p></td></tr><tr><td class="confluenceTd"><p><img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e2FuY2hvcjpwYXJhbWV0ZXJCcmFuY2h9&locale=en_GB&version=2" data-macro-name="anchor" data-macro-default-parameter="parameterBranch">sonar.branch</p></td><td class="confluenceTd"><p>Manage SCM branches. Two branches of the same project are considered as different projects in Sonar.</p></td><td class="confluenceTd"><p> </p></td><td class="confluenceTd"><p>since 1.10</p></td></tr><tr><td class="confluenceTd"><p>sonar.profile</p></td><td class="confluenceTd"><p>Through the Sonar web interface, you can define as many quality profiles as you want and you can easily associate one of this quality profile to a given project.</p></td><td class="confluenceTd"><p>Default profile for the given language</p></td><td class="confluenceTd"><p>since 1.6</p></td></tr><tr><td class="confluenceTd"><p>sonar.skipDesign</p></td><td class="confluenceTd"><p>Deactivate Java bytecode analysis. Since Sonar 2.0, the java bytecode is analyzed by Sonar in order to extract dependencies between packages and files. Those dependencies are used for instance to display the DSM (Dependency System Matrix). This bytecode analysis can be deactivated.</p></td><td class="confluenceTd"><p>false</p></td><td class="confluenceTd"><p>since 2.0</p></td></tr><tr><td class="confluenceTd"><p>sonar.phase</p></td><td class="confluenceTd"><p>Run maven phase or goal prior to analysis. When Sonar needs a phase or maven goal to be executed prior to analysis, this parameter can be used. For example sonar.phase=<a href="http://svn.codehaus.org/sonar/trunk/tests/integration/reference-projects/plugin-build-helper/pom.xml">generate-sources</a>. This property is used only for Maven analysis.</p></td><td class="confluenceTd"><p> </p></td><td class="confluenceTd"><p>since 1.10</p></td></tr><tr><td colspan="1" class="confluenceTd"><p>sonar.dynamicAnalysis</p></td><td colspan="1" class="confluenceTd"><p>Dynamic analysis relates to unit tests. By default, those unit tests are executed but you can optionally decide to do only static analysis or to reuse existing reports which have been previously generated. Possible values are true, false, reuseReports.</p><p>See the <a class="confluence-link" href="/display/SONAR/Code+Coverage+by+Unit+Tests+for+Java+Project" data-linked-resource-id="230397062" data-linked-resource-type="page" data-linked-resource-default-alias="Code Coverage by Unit Tests for Java Project" data-base-url="http://docs.codehaus.org">Code Coverage by Unit Tests tutorial</a> for details and examples.</p></td><td colspan="1" class="confluenceTd"><p>true</p></td><td colspan="1" class="confluenceTd"><p>since 1.7</p></td></tr><tr><td colspan="1" class="confluenceTd"><img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e2FuY2hvcjp3b3JraW5nRGlyZWN0b3J5fQ&locale=en_GB&version=2" data-macro-name="anchor" data-macro-default-parameter="workingDirectory">sonar.working.directory</td><td colspan="1" class="confluenceTd">To set the working directory for the Sonar Runner or the Sonar Ant Task (versions greater than 2.0).</td><td colspan="1" class="confluenceTd">.sonar</td><td colspan="1" class="confluenceTd"> </td></tr></tbody></table><h2>Sonar Configuration</h2><table class="confluenceTable"><tbody><tr><th class="confluenceTh"><p>Key</p></th><th class="confluenceTh"><p>Description</p></th><th class="confluenceTh"><p>Default value</p></th><th class="confluenceTh"><p>Version</p></th></tr><tr><td class="confluenceTd"><p>sonar.host.connectTimeoutMs sonar.host.readTimeoutMs</p></td><td class="confluenceTd"><p>Increasing HTTP timeouts of requests to Sonar server. The Maven plugin executes some HTTP requests to the Sonar server. Two timeouts makes the call fail if the server connection is too slow. In such a case the timeouts can be increased from Maven properties.</p></td><td class="confluenceTd"><p>respectively 30'000 and 60'000 milliseconds</p></td><td class="confluenceTd"><p>since 1.12</p></td></tr></tbody></table><h2>Log</h2><table class="confluenceTable"><tbody><tr><th class="confluenceTh"><span style="color: rgb(0,51,102);">Key</span></th><th class="confluenceTh"><span style="color: rgb(0,51,102);">Description</span></th><th class="confluenceTh"><span style="color: rgb(51,51,153);"><span style="color: rgb(0,51,102);">Default value</span></span></th><th class="confluenceTh"><span style="color: rgb(204,153,255);"><span style="color: rgb(0,51,102);">Version</span><br /></span></th></tr><tr><td class="confluenceTd">sonar.showSql</td><td class="confluenceTd">Display all the SQL requests executed on batch side</td><td class="confluenceTd">false</td><td class="confluenceTd">since Sonar 2.14, Sonar <span style="color: rgb(34,34,34);">Ant Task 1.4 & Sonar Runner 1.3</span></td></tr><tr><td colspan="1" class="confluenceTd">sonar.showSqlResults</td><td colspan="1" class="confluenceTd">Display the result of all SQL requests executed on batch side</td><td colspan="1" class="confluenceTd">false</td><td colspan="1" class="confluenceTd">since Sonar 2.14, <span>Sonar </span><span style="color: rgb(34,34,34);">Ant </span><span style="color: rgb(34,34,34);">Task 1.4 & Sonar Runner 1.3</span></td></tr><tr><td class="confluenceTd">sonar.verbose</td><td class="confluenceTd">Activation of the DEBUG mode on batch side</td><td class="confluenceTd">false</td><td class="confluenceTd">since Sonar 2.12<span>, <span>Sonar </span><span style="color: rgb(34,34,34);">Ant </span></span><span style="color: rgb(34,34,34);">Task 1.3 & Sonar Runner 1.2</span></td></tr></tbody></table>
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