Adding SonarQube Scanner for MSBuild
Go to Manage Jenkins and Configure System
Click on MSBuild SonarQube Runner installations...
Add an installation of the latest available version. Check Install automatically to have the SonarQube Scanner for MSBuild
automatically provisioned on your Jenkins executors
If you do not see any available version under Install from GitHub, first go to Manage Jenkins > Manage Plugins > Advanced and click on Check now
- Click Save
Configuring a SonarQube Scanner using environment variables
Analyzing with SonarQube Scanner for MSBuild
- Open the configuration of a new or existing job
- Add both the SonarQube for MSBuild - Begin Analysis and SonarQube for MSBuild - End Analysis build steps to your build
- Configure the SonarQube Project Key, Name and Version in the SonarQube Scanner for MSBuild - Begin Analysis build step
Use the MSBuild build step or the Execute Windows batch command to execute the build with MSBuild 14 (compatibility) between the Begin Analysis and End Analysis steps.
Analyzing with the SonarQube Scanner