Message-ID: <1225159881.2415.1418959224112.JavaMail.email@example.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2414_638555420.1418959224112" ------=_Part_2414_638555420.1418959224112 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The SonarQube Runner is recommended as the default launcher to analyze a= project with SonarQube.
You must have previously install= ed the SonarQube Runner and read Analyzing Code Source. You must also have the language = plugins installed for each of the languages you wish analyzed in your proje= cts.
Create a configuration file in the root directory of the project: sonar<= em>-project.properties
Run the following command from the project base directory to l= aunch the analysis:
Any user who's granted Execu= te Analysis permission can run an analysis.
If the Anyone group is not granted Execute A=
nalysis permission or if the SonarQube instance is secured (the
tication property is set to
code>, the credentials of a user having been granted Execute Analy=
sis permission have to be provided through the
sonar.password properties. Exam=
sonar-runner -Dsonar.login=3DmyLogin -Dsonar.password=3DmyP=
Note that for a preview/incremen= tal analysis, the user also has to be granted the Browse = permission on the project to be analyzed.
If a project cannot be accessed anonymously, the
sonar.password properties =
are required to run an analysis on this project. These properties have to b=
e set to the credentials of a user having the User role =
on this project. You can set them either:
-Dsonar.login=3DmyLog= in -Dsonar.password=3DmyPassword
A project cannot be anonymously accessed when either:
sonar.forceAuthentica= tionproperty is set to
sonar.forceAuthent= icationproperty is set to
falseand= the Anyone group has not been granted a User= em> role on the project
There is no security restriction.
Since SonarQube 4.2, it is possible to run an analysis on a multi-langua=
ge project. To do so, the
sonar.language property just has to =
be removed. Conversely, if for some reason you want to perform a single lan=
guage-only analysis, make sure
sonar.language is specified.
The first step is to choose which one of these two mono-language project= s you will convert to a multi-language project. You will lose the history (= timeline, false positives, action plans, etc.) on the one that won't get co= nverted to a multi-language project. In this example, we'll choose to conve= rt the Java project to a multi-language project as most of our code (and th= erefore history) is Java.
The second step is to run another analysis of this Java project the old =
way (make sure to explicitly set the
java). This step is mandatory to keep the his=
tory on the project.
The third and last step is to remove the
sonar.language property and set the
sonar.sources property t=
You can now run another analysis. You will finally be able to browse your =
first multi-language project!
There are two ways to define a multi-module structure in SonarQube:
|Using the given file structure...<= /th>||... with the given 'properties' files|
= Set all the configuration in the properties file in the root folder
= Set the configuration in multiple properties files
the folder of a module contains white spaces or special characters:<= /p>
the module is not located directly in the parent folder, but in a de= eper directory structure:
If a sonar-project.properties file cannot be created in the roo= t directory of the project, there are several alternatives:
The properties can be specified directly through the comma= nd line. Ex:
project.settings can be used to specify th=
e path to the project configuration file (this option is incompatible with =
The root folder of the project to analyze can be set through the
onar.projectBaseDir property since SonarQube Runner 2.4 (was pr=
project.home). This folder must contain a sonar-p=
roject.properties file if the mandatory properties (like
rojectKey) are not specified on the command line.
If the files to be analyzed are not in the directory where the analysis =
starts from, use the
projectBaseDir property to move analysis to a different directory. E.G. analysis =
begins from jenkins/jobs/myjob/workspace but the files t=
o be analyzed are in ftpdrop/cobol/project1.
For more, see the listing of analysis= parameters.