Triggering Scan
Here's an example of a SonarScanner command that triggers a scan to SonarCloud with properties passed as attributes:
sonar-scanner \
-Dsonar.projectKey=your_project_key \
-Dsonar.organization=your_organization_key \
-Dsonar.sources=src \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=your_authentication_tokenIn this example:
Replace
your_project_keywith the key of your project in SonarCloud.Replace
your_organization_keywith the key of your organization in SonarCloud.Adjust the value of
sonar.sourcesto the directory containing your source code that you want to analyze.Set
sonar.host.urlto the URL of SonarCloud (https://sonarcloud.io for the public instance).Replace
your_authentication_tokenwith the access token or authentication token for your SonarCloud account.
Last updated