How to do it...

  1. Go to the Build section and select Execute SonarQube Scanner:
  1. You can provide the location of or provide details directly for static code analysis.
# Required metadata 
sonar.projectName=Simple HTML CSS JS project analyzed with the SonarQube 
# Comma-separated paths to directories with sources (required) 
# Encoding of the source files 
  1. sonar.sources is the main property for static code analysis. With this property, you inform SonarQube which directory needs to be analyzed:
  1. Click on Save.
  2. Go to Jenkins ...

Get Jenkins 2.x Continuous Integration Cookbook - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.