環境準備
說明:本文章使用的ES版本是:6.7.0
JDK
Elastisearch 6.7.0編譯需要JDK版本10.0及以上,我直接安裝了JDK12.JDK下載地址:https://www.oracle.com/technetwork/java/javase/downloads/index.html
Gradle
brew install gradle
Elastisearch源碼
git clone https://github.com/elastic/elasticsearch.git
git tag
git checkout v6.7.0
使用IDEA DEBUG 源碼
將工程Import到IDEA
進入Elastisearch根目錄,把源碼編譯爲IDEA工程:./gradlew idea