Salesforce_Sonar - sandeepvalapi/DevOps GitHub Wiki

Developer steps - follow these steps to setup sonarqube for SFRA applications

  • Download Sonarqube
  • Download Sonar-Scanner
  • Change the sonar-scanner/conf/sonar-scanner.properties attribute
sonar.host.url=http://localhost:9000
  • Create sonar-project.properties in the root of your project with below details in it
# must be unique in a given SonarQube instance
sonar.projectKey=my:sfra

# --- optional properties ---

# defaults to project key
sonar.projectName=My SFRA
# defaults to 'not provided'
sonar.projectVersion=1.0
 
# Path is relative to the sonar-project.properties file. Defaults to .
sonar.sources=.
sonar.projectBaseDir=.
 
# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
sonar.login=admin
sonar.password=password

  • Run the below command from the root of your project directory
../sonar-scanner/bin/sonar-scanner -Dsonar.sources="." -Dsonar.login="admin" -Dsonar.password="password"
  • After running the above command you will see EXECUTION SUCCESS message