- 设置 maven 配置或者系统环境变量(1)maven 配置
❝左上角 IntelliJ IDEA ==> Perferences
❞
❝设置doris.thrift变量值
❞
(2)系统环境配置
- 终端输入命令:
sudo vi ~/.bash_profile
- 添加 DORIS_THRIFT 变量,value是「thirdparty」文件夹绝对路径
- 编辑完成之后保存文件
- 终端输入命令:
source ~/.bash_profile
4、源码编译
- 先编译fe-common 项目
- 解决报错:Unable to find: checkstyle-apache-header.txt
- 再次 install fe-common项目,又遇见报错:
Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (sign-release-artifacts) on project fe-common: Unable to execute gpg command: Error while executing process. Cannot run program "gpg": error=2, No such file or directory -> [Help 1]
「解决方式」:在fe-common.pom加入org.apache.maven.plugins依赖:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <version>1.6</version> <configuration> <skip>true</skip> </configuration> </plugin>
- 继续编译fe-common项目
- 编译spark-dpp 项目
如果出现该报错:
Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (sign-release-artifacts) on project fe-common: Unable to execute gpg command: Error while executing process. Cannot run program "gpg": error=2, No such file or directory -> [Help 1]
在spark-dpp.pom 文件添加 org.apache.maven.plugins
依赖:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <version>1.6</version> <configuration> <skip>true</skip> </configuration> </plugin>
- 编译 fe项目
「编译fe项目的目的是生成 fe-core target文件,不能直接编译fe-core,因为fe-core依赖fe部分文件,所以我们需要先编译fe项目」
5、启动fe-core项目
- 创建文件夹logs、webroot、logs、doris-meta
- 设置fe-core启动类变量
变量设置:
JAVA_OPTS=-Xmx1024m; DORIS_HOME=/Users/apple/Workspaces/Doris源码_1.0.0; PID_DIR=/Users/apple/Workspaces/Doris源码_1.0.0/fe; LOG_DIR=/Users/apple/Workspaces/Doris源码_1.0.0/fe/logs
- 启动 fe-core
四、总结
使用IDEA编译Apache Doris FE源码过程中,出现了很多报错,我进行了总结:
Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (sign-release-artifacts) on project fe-common: Unable to execute gpg command: Error while executing process. Cannot run program "gpg": error=2, No such file or directory -> [Help 1]
❝解决方式:缺少maven-gpg-plugin依赖,在pom文件添加即可,配置文件如下:
❞
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <version>1.6</version> <configuration> <skip>true</skip> </configuration> </plugin>
Unable to find: checkstyle-apache-header.txt
❝解决方式:checkstyle-apache-header.txt文件的路径不对,如下 图:
❞
thrift did not exit cleanly. Review output for more information.
❝解决方式:thrift文件的路径不对,请看Maven环境配置章节!
❞
Module 'fe-core' production : java.lang.OutOfMemoryError: GC overhead limit exceeded
❝解决方式:Maven的编译器内存不够,添加内存即可,如图
❞