'SONAR'에 해당되는 글 1건

1. git repository  에서 source check out

- git 플러그인이 설치되지 않았다면 git 플러그인을 설치 한다.(eclipse kepler user는 기본으로 설치되어 있다)

- Window -> Show View -> Git Repositories

- https://github.com/SonarSource/sonar.git (복사)

- Git Repositories 에서 Clone a Git Repository 선택(sonar git url 주소가 클립보드에 복사되어 있다면 자동으로 선택된다.)

- 소스를 check out 받으면 git 설정을 변경하지 않았다면 $USER_HOME/git/ 밑으로 체크아웃 받는다. (이클립스 구동시에 내가 선택한 workspace에 체크아웃 받지 않는다)

- Working Directory 를 선택하고 Import 를 하도록 한다.

- 현시점은 4.0-SNAPSHOT 버전이다. BRANCH 에서 자신이 빌드할 버전은 선택한다.

- import 한 프로젝트를 선택하고 Import -> Existing Maven Projects 를 선택한다. (sonar 는 maven 프로젝트로 구성되어 있다.) 

필요한 환경

- git 플러그인

- maven 플러그인

- sonar maven 빌드시 필요한 maven connector

2. database 설정 변경

- sonar-server 프로젝트가 웹서버를 가동시키는 프로젝트이다(packaging war)

- src/dev/mysql/conf/sonar.properties 에서 설정 변경 (설정을 변경하지 않고 sonar DB 에 sonar/sonar mysql user 를 생성하면 별 설정없이 사용가능하다)

mysql -uroot

mysql > create database sonar;

mysql > grant all privileges on sonar.* to sonar@localhost identified by 'sonar';

mysql > flush privileges;

3. jetty run

- 먼저 import 한 프로젝트를 local repository에  빌드한다. (install 시 skip test 를 선택하자. sonar 프로젝트를 빌드하는게 목적이다.)

[WARNING] Rule 3: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
To build this project Maven 3.0.5 (or upper) is required. Please install it.

-> eclipse kepler 의 내장 maven 버전은 3.04 이다. maven home page 에서 상위버전을 다운로드 받은후 eclipse maven 설정에서 기본 maven 을 변경한다.

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

-> Eclipse 설정에서 Istalled JREs -> JAVASE-1.7  -> jdk 로 변경(jre 로 선택되어있을경우 오류 발생)

- sonar-server 프로젝트에 maven 플러그인으로 org.mortbay.jetty 설정되어 있음을 볼수 있다.

- port 와 context는 적절하게 변경하고 jetty 를 실행해보자

- sonar-server -> Run As -> Maven build... -> clean jetty:run -Pstart-dev-server,mysql

- server 가 정상적으로 구동되면 sonar DB 에 table 과 기본 데이터가 세팅이 되어 있음을 확인할 수 있다.

- 서버 구동시에 OutOfMemory 가 발생시에는 서버 구동시 적절한 메모리 옵션을 주도록한다.

4. browser에서 확인

 - http://localhost:9000/dev/

- 기본계정 : admin/admin

 

블로그 이미지

비추마

,