Table of Contents
SonarQube C# 소스코드 진단툴
라이센스
Community Edition
라이센스: LGPL v3 (GNU Lesser General Public License v3)
다운로드
아래 링크에서 Community Edition 을 다운받습니다.
https://www.sonarsource.com/products/sonarqube/downloads/
실행
StartSonar.bat
ERROR: java.exe not found. Please make sure that the environmental variable SONAR_JAVA_PATH points to the Java executable.
SONAR_JAVA_PATH 를 설정해 줍니다. bin 경로가 아닌 bin\java.exe 와 같이 실행파일명을 포함시켜 주어야 합니다.
[설치경로]/bin/windows-x86-64/StartSonar.bat
접속하기
http://localhost:9000
admin/admin
프로젝트 생성
Create a local project
.NET Core 인 경우
# 프로젝트 루트로 이동 후
dotnet tool install --global dotnet-sonarscanner
dotnet sonarscanner begin /k:"SpyOut-App" /d:sonar.host.url="http://localhost:9000" /d:sonar.token="sqp_42bbdc04c41e540cXXXXXXXXXX"
dotnet build
dotnet sonarscanner end /d:sonar.token="sqp_42bbdc04c41e540cXXXXXXXXXX"
.NET 인 경우
여기 에서 Sonar Scanner for .NET 을 다운받아 설치합니다.
Developer Command Prompt 를 실행하고 아래 명령을 입력합니다.
# 프로젝트 루트로 이동 후
[sonar-scanner-11.X.X.XXXXX-net-framework 설치경로]\SonarScanner.MSBuild.exe begin /k:"SpyOut-API" /d:sonar.host.url="http://localhost:9000" /d:sonar.token="sqp_f31d0df9568de66b07cXXXXXXXXXX"
MsBuild.exe /t:Rebuild
[sonar-scanner-11.X.X.XXXXX-net-framework 설치경로]\SonarScanner.MSBuild.exe end /d:sonar.token="sqp_f31d0df9568de66b07cXXXXXXXXXX"