[Elasticsearch] Contribution 하기 위한 준비 작업

Elastic/Elasticsearch 2018. 4. 4. 12:31

Elasticsearch 소스코드를 수정 하거나 디버깅을 하고 싶을 때가 있습니다.

로컬에서 빌드 부터 해야 가능하겠죠.


특별히 contributing 을 목적으로 하지는 않지만, 그래도 이왕이면 버그 수정도 하고 contribution 도 하면 좋겠죠.


아래는 이미 문서에 자세히 나와 있는 내용을 그냥 요약 정도 해본 내용입니다.

(기억을 위해 한번 더 작성해 본 내용입니다.)


Reference)

https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md

https://github.com/elastic/elasticsearch/blob/master/TESTING.asciidoc


사전 준비 도구)

- JDK 10 다운로드 및 설치 (Build 용)

- JDK 8 다운로드 및 설치 (Runtime 용)

- Gradle 4.3 다운로드 및 설치


JDK 10 설치 후 환경변수 설정)

$ vi .bash_profile

export JAVA_HOME=$(/usr/libexec/java_home)

export RUNTIME_JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home


Intellij 환경설정)

This can be achieved by adding the -Didea.no.launcher=true JVM option. 

IntelliJ, go to Run->Edit Configurations...->Defaults->JUnit->VM options and input -ea.

$ ./gradlew idea


Formatting 설정)

- Java indent is 4 spaces

- Line width is 140 characters

- IntelliJ: Preferences/Settings->Editor->Code Style->Java->Imports

- Class count to use import with '*' and Names count to use static import with '*'. Set their values to 99999


Elasticsearch run)

$ ./gradlew run


# 실행 시 9200과 9300 port 로 실행 중인 elasticsearch daemon 이 있으면 에러 발생 합니다.


Logging level 설정)

# path : distribution/src/config/log4j2.properties


$ vi log4j2.properties

ASIS)

rootLogger.level = info


TOBE)

rootLogger.level = debug


Create distribution)

$ ./gradlew assemble

$ ./gradlew check


: