1:下載並解壓SonarQube(http://www.sonarqube.org/downloads/)java
2:啓動SonarQube Server瀏覽器
3:下載並解壓SonarQube Scanner(http://docs.sonarqube.org/display/SONAR/Installing+and+Configuring+SonarQube+Scanner)用來掃描項目使用,並配置環境變量 例如:path=..\sonar-runner-2.4\binmaven
4:找一個項目工程,maven、ant或者其它工程。配置sonar-project.properties,具體配置以下:ui
# Required metadata
sonar.projectKey=word-set(工程名稱)
sonar.projectName=word-set(工程名稱)
sonar.projectVersion=1.1
# Comma-separated paths to directories with sources (required)
sonar.sources=src
sonar.binaries=target
# Language
sonar.language=java
# Encoding of the source files
sonar.sourceEncoding=UTF-8spa
5:cd命令行進入工程命令行
執行sonar-runnerget
6:瀏覽器下執行 http://localhost:9000it