elasticsearch源码编译与调试 - mouse3150/mouse3150.github.io GitHub Wiki

1. elasticsearch编译为 idea 工程:

gradlew idea

编译失败则按照错误信息解决问题,可用使用如下命令帮助定位问题:

gradlew idea -info

gradlew idea -debug

2. 编译源代码:

gradlew build

3. 导入IDEA, Edit Configurations

Main Class : org.elasticsearch.bootstrap.Elasticsearch

VM Option :

-Des.path.home=

-Des.path.conf=

-Dlog4j2.disable.jmx=true

Use classpath of modules: elasticsearch.server.main

3. 启动异常

(1)、java.lang.NoClassDefFoundError: org/elasticsearch/plugins/ExtendedPluginsClassLoader 解决方案:changing "compileOnly project(':libs:elasticsearch-plugin-classloader')" to "compile project(':libs:elasticsearch-plugin-classloader')"

3.编译源代码

gradlew build