The SonarScanner is the scanner to use when there is no specific scanner for your build system.
Configuring your project
Create a configuration file in your project's root directory called
sonar-project.properties
Running SonarScanner from the zip file
To run SonarScanner from the zip file, follow these steps:
- Expand the downloaded file into the directory of your choice. We'll refer to it as
$install_directory
in the next steps. - Update the global settings to point to your SonarQube server by editing
$install_directory/conf/sonar-scanner.properties
: - Add the
$install_directory/bin
directory to your path. - Verify your installation by opening a new shell and executing the command
sonar-scanner -h
(sonar-scanner.bat -h
on Windows). You should get output like this:If you need more debug information, you can add one of the following to your command line:-X
,--verbose
, or-Dsonar.verbose=true
. - Run the following command from the project base directory to launch the analysis:
sonar-scanner
Running SonarScanner from the Docker image
Below is an example of verbose output in a Windows command line screen. There are several ways to enable Verbose Mode. During startup, the screen may display which key(s) to press on the keyboard to enable Verbose Mode. Usually, users would press the Esc (escape) key for Linux, Ctrl+V keys for Microsoft Windows, and Command-V keys for macOS. This turns on Verbose mode and it means that Terminal will list every file it's copying, as it's copying it. You get to see more detail and you see it immediately. So that looks good — except. If your Mac is using a firmware password, you're prompted to enter the password. Option-Command-P-R: Reset NVRAM or PRAM. If your Mac is using a firmware password, it ignores this key combination or starts up from macOS Recovery. Shift (⇧): Start up in safe mode. Disabled when using a firmware password. Create a Python web app in Azure; Run a custom Docker Hub image in Azure Web Apps for Containers; Give feedback. We welcome your feedback for the CLI to help us make improvements and resolve bugs. You can file an issue on GitHub or use the built-in features of the CLI to leave general feedback with the az feedback command. Az feedback See also. Just connect to the remote Mac using SSH and run the terminal command above. What Your Mac Does In Verbose Mode. In short, verbose mode replaces boot graphics with text mode so that show you everything that the computer does during startup.
To scan using the SonarScanner Docker image, use the following command: How to delete apps off launchpad on mac.
Sample Projects
To help you get started, simple project samples are available for most languages on GitHub. They can be browsed or downloaded. You'll find them filed under sonarqube-scanner/src.
Alternatives to sonar-project.properties
If a sonar-project.properties file cannot be created in the root directory of the project, there are several alternatives:
- The properties can be specified directly through the command line. Ex:
- The property project.settings can be used to specify the path to the project configuration file (this option is incompatible with the
sonar.projectBaseDir
property). Ex: - The root folder of the project to analyze can be set through the
sonar.projectBaseDir
property since SonarScanner 2.4. This folder must contain asonar-project.properties
file ifsonar.projectKey
is not specified on the command line.Additional analysis parameters can be defined in this project configuration file or through command-line parameters.
Alternate Analysis Directory
If the files to be analyzed are not in the directory where the analysis starts from, use the
sonar.projectBaseDir
property to move analysis to a different directory. E.G. analysis begins from jenkins/jobs/myjob/workspace
but the files to be analyzed are in ftpdrop/cobol/project1
.This is configured in sonar-project.properties
as follows:You can configure more parameters. See Analysis Parameters for details.
Advanced Docker Configuration
The following sections offer advanced configuration options when running the SonarScanner with Docker. Click the headings to expand the instructions.
Running as a non-root user
You can run the Docker image as a non-root user using the
--user
option. For example, to run as the current user:When running the container as a non-root user you have to make sure the user has read and write access to the directories you are mounting (like your source code or scanner cache directory), otherwise you may encounter permission related problems.
Caching scanner files
To prevent SonarScanner from re-downloading language analyzers each time you run a scan, you can mount a directory where the scanner stores the downloads so that the downloads are reused between scanner runs. On some CI systems, you also need to add this directory to your CI cache configuration.
Run Mac App From Command Line In Verbose Mode Google Chrome
The following command will store and use cache between runs:
You can also change the location of where the scanner puts the downloads with the
SONAR_USER_HOME
environment variable.Using self-signed certificates
If you need to configure a self-signed certificate for the scanner to communicate with your SonarQube instance, we recommend using the OpenJDK provided with the
sonarsource/sonar-scanner-cli
image. To do this, follow these steps: - Extract the
cacerts
file from OpenJDK from thesonarsource/sonar-scanner-cli
image:
- Add your certificate to the exported
cacerts
file. Assuming your certificate file is namedmycert.cer
and it's in your current local directory:
- Mount the
cacerts
file that you've prepared in your target container:
Troubleshooting
Java heap space error or java.lang.OutOfMemoryError
Increase the memory via the
Increase the memory via the
SONAR_SCANNER_OPTS
environment variable when running the scanner from a zip file:On Windows environments, avoid the double-quotes, since they get misinterpreted and combine the two parameters into a single one.
![Run Mac App From Command Line In Verbose Mode Run Mac App From Command Line In Verbose Mode](/uploads/1/3/4/2/134243891/731043882.png)
Run Mac App From Command Line In Verbose Mode Chrome
Unsupported major.minor version
Best 3d app for mac. Upgrade the version of Java being used for analysis or use one of the native package (that embed its own Java runtime). Task percentage mac app.
Best 3d app for mac. Upgrade the version of Java being used for analysis or use one of the native package (that embed its own Java runtime). Task percentage mac app.
Run Mac App From Command Line In Verbose Mode Download
Property missing: `sonar.cs.analyzer.projectOutPaths'. No protobuf files will be loaded for this project.
Scanner CLI is not able to analyze .NET projects. Please, use the Scanner for MSBuild. If you are running Scanner for MSBuild, ensure that you are not hitting a known limitation.
Scanner CLI is not able to analyze .NET projects. Please, use the Scanner for MSBuild. If you are running Scanner for MSBuild, ensure that you are not hitting a known limitation.