ㄴ이 문서는 Windows 환경에서 SonarQube 설치 가이드 문서를 제공한다.
JAVA 설치파일 web site에 접속하여 JAVA를 Download한다.
설치 파일 구분을 위해 C:\curvc-install\java 폴더 생성 및 압축 해제한다.
JAVA_HOME을 WIndows 시스템 환경 변수에 등록한다.
java -version |
PostgreSQL 설치파일 web site에 접속하여 PostgreSQL을 Download한다.
설치 파일 구분을 위해 C:\curvc-install\postgresql-14 폴더 생성 및 압축 해제한다.
-U postgres
: 데이터베이스 superuser 이름 지정.-A password
: 로컬 연결 시 인증 방법을 비밀번호로 설정.-W
: 새 superuser의 비밀번호를 묻는 메시지 설정.-E UTF8
: 데이터베이스의 인코딩을 UTF8로 설정.-D C:\curvc-install\postgresql-14\pgsql\data
: 데이터베이스 파일이 저장될 디렉터리를 지정.C:\curvc-install\postgresql-14\pgsql\bin\initdb.exe -U postgres -A password -W -E UTF8 -D C:\curvc-install\postgresql-14\pgsql\data |
C:\curvc-install\postgresql-14\pgsql\bin\pg_ctl -D C:\curvc-install\postgresql-14\pgsql\data -l C:\curvc-install\postgresql-14\pgsql\logs\server.log start |
C:\curvc-install\postgresql-14\pgsql\bin\psql -U postgres |
SonarQube와 연동해야 할 DB를 구성 해 준다.
# 유저 생성 create role sonar with login password 'sonar'; # DB 생성(UTF8) CREATE DATABASE sonar WITH OWNER sonar ENCODING 'UTF8' LC_COLLATE='en_US.utf8' LC_CTYPE='en_US.utf8' TEMPLATE=template0; # 권한 설정 grant all privileges on DATABASE sonar to sonar; |
아래와 같이 Command로 실행하거나 Windows 서비스에서도 실행 가능하다.
PostgreSQL 서비스를 등록하기 전에 명령어로 실행한 PostgreSQL 를 종료해야 한다. |
# 서비스 등록 cd C:\curvc-install\postgresql-14\pgsql\bin pg_ctl register -N postgresql14 -D C:\curvc-install\postgresql-14\pgsql\data # cmd 서비스 실행 net start postgresql14 |
등록 후 PostgreSQL 서비스가 정상적으로 실행되지 않을 경우, 다음 절차를 통해 삭제 후 재등록하여 실행한다.
|
SonarQube의 web site 접속 하여 SonarQube를 Download 한다.
설치 파일 구분을 위해 C:\curvc-install\postgresql-14 폴더 생성 및 압축 해제한다.
SonarQube와 연동 해야 할 DB를 구성 해 준다.
psql create role sonar with login password 'sonar'; create database sonar owner=sonar; grant all privileges on DATABASE sonar to sonar; |
// setx SONAR_JAVA_PATH "java.exe 경로" setx SONAR_JAVA_PATH "C:\curvc-install\java\jdk-17\bin\java.exe" |
경로 지정 한 sonarqube-10.5.1\conf\sonar.properties 파일을 변경 한다.
경로 지정 한 sonarqube-10.5.1\bin\windows-x86-64 이동 한다.(운영체제가 32bit 경우 windows-x86-32 으로 이동한다.)
# 서비스 등록 \sonarqube\bin\windows-x84-64\StartService.bat install # 서비스 실행 \sonarqube\bin\windows-x84-64\StartService.bat start |
http://localhost:9000 or http://ipaddress:9000 으로 접속 한다.
ID / PW : admin / admin