一、编译前提
1、安装 openjdk1.8
2、安装 nodejs
3、安装 maven
4、安装 git
5、安装 postgresql-12
二、拉取 thingsboard 源码
git clone https://github.com/thingsboard/thingsboard.git
三、修改 thingsboard 目录下 pom 文件 注释:
1、/root/thingsboard/pom.xml
a) 约 690 行 com.mycila license-maven-plugin ··· ···
b) 约 752 行
2、注释 ./thingsboard/msa/js-executor/pom.xml 和./thingsboard/msa/web-ui/pom.xml 中 maven-assembly-plugin
a) vi ./thingsboard/msa/js-executor/pom.xml 约 100 行
b) vi ./thingsboard/msa/web-ui/pom.xml 约 148 行
四、修改 pom 文件中 node 版本和 npm 版本与本地版本相同
vi thingsboard/ui-ngx/pom.xml 约 60 行
vi thingsboard/msa/js-executor/pom.xml 约 74 行
vi thingsboard/msa/web-ui/pom.xml 约 83 行
五、修改 thingsboard/ui-ngx/package.json 文件
"scripts": {
"postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points",
"ng": "ng",
"start": "ng serve --host 0.0.0.0 --open",
"build": "node --max-old-space-size=8000 ng build", ========修改处
"build:prod": "ng build --prod --vendor-chunk",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
}
六、在 thingsboard 目录执行编译即可。
mvn clean install -dskiptests
tips:
a) 编译对网络环境要求苛刻,源码可从码云拉取 git clone https://gitee.com/mirrors/thingsboard.git
b) 编译时,需要从外网拉依赖,如果可以的话,搭个梯子。
本人小白一枚,如有错误之处,还请前辈们指教!