시스템운영

SonarQube 분석 방법

호이잇! 2017. 8. 22. 14:45

sonar-runner-2.4.zip



분석 방법

sonar-runner 압축해제


/conf/sonar-runner.properties 

주석해제 및 db 경로 설정 및 db 유저 패스워드 설정


분석 할 프로젝트에서 sonar-project.properties 파일 생성


내용


# must be unique in a given SonarQube instance

sonar.projectKey=my:project

# this is the name displayed in the SonarQube UI

sonar.projectName=My project

sonar.projectVersion=1.0

 

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.

# Since SonarQube 4.2, this property is optional if sonar.modules is set. 

# If not set, SonarQube starts looking for source code from the directory containing 

# the sonar-project.properties file.

sonar.sources=.

 

# Encoding of the source code. Default is default system encoding

#sonar.sourceEncoding=UTF-8 


sonar-runner -Dsonar.analysis.mode=preview -Dsonar.issuesReport.html.enable=true -Dsonar.report.export.path=report.json -Dsonar.host.url=http://localhost:9000

프로젝트 루트 경로에서 sonar-runner.bat 실행