...
| Code Block | ||||
|---|---|---|---|---|
| ||||
# required metadata sonar.projectKey=my:project sonar.projectName=My project sonar.projectVersion=1.0 # optional description sonar.projectDescription=Fake description # path to source directories (required) sonar.sources=srcDir1,srcDir2 # path to test source directories (optional) sonar.tests=testDir1,testDir2 # path to project binaries (optional), for example directory of Java bytecode sonar.binaries=binDir # optional comma-separated list of paths to libraries. Only path to JAR file and path to directory of classes are is supported. sonar.libraries=path/to/library/*.jar,path/to/classes/dirspecific/library/myLibrary.jar,parent/*/*.jar # The value of the property must be the key of the language. sonar.language=cobol # Additional parameters sonar.my.property=value |
...
Security
Since Sonar 3.4, if you have set the security property a project cannot be accessed anonymously, the 'sonar.forceAuthenticationlogin' to and 'true', sonar.password' properties are required to run the analysis, you an analysis on this project. These properties have to be set to the 'sonar.login' and 'sonar.password' properties to an existing user, credentials of a user having the 'User' role on this project. You can set them either:
- directly on the command line by adding -Dsonar.login=myUser -Dsonar.password=myPassword
- or by setting these two properties in the 'sonar-project.properties' project configuration file
- or in the 'sonar-runner.properties' global configuration file
A project cannot be anonymously accessed when either:
- the 'sonar.forceAuthentication' property is set to 'true'
- or the 'sonar.forceAuthentication' property is set to 'false' and the 'Anyone' group has not been granted a 'User' role on the project
Project Samples
To help you getting started, for each language, a simple project sample is available on github that can be browsed or downloaded: projects/languages
...
Since Sonar 3.3, it is possible to run an analysis on a multi-module project whose modules contains source code from different languages.
In addition to the multi-module configuration, the only mandatory property to set is the language for each module:
...
The properties can be specified directly through the command line. Ex:
Code Block language none sonar-runner -Dsonar.projectKey=myproject -Dsonar.sources=src1
The property 'project.settings' can be used to specify the path to the project configuration file (this option is incompatible with the 'project.home' property). Ex:
Code Block language none sonar-runner -Dproject.settings=../myproject.properties
The Sonar working directory can be set through the 'sonar.working.directory' property (default is '.sonar').The root folder of the project to analyze can be set through the 'project.home' property. This folder must contain a sonar-project.properties file if the mandatory properties (like 'sonar.projectKey') are not specified on the command line.
...

