技术交流

学习资料

立即试用 商务报价
社区版
社区版 专业版 云服务 Edge Edge PE 网关 授权服务 Trendz分析 Mobile 应用程序 Mobile PE应用程序
文档 > 开发指南 > 源码编译
入门
指南 安装 架构 API 常见问题

本页目录

源码编译

拉取源码

1
git clone https://github.com/thingsboard/thingsboard.git

切换分支

1
git checkout release-2.5

环境变量

image

运行环境检查

image

Maven中央仓库设置

1
2
3
4
5
6
    <mirror>         
      <id>repo1</id>         
      <name>repo1 maven</name>         
      <url>https://repo1.maven.org/maven2/</url>        
      <mirrorOf>central</mirrorOf>
    </mirror>

npm镜像设置

1
2
3
4
npm install -g mirror-config-china --registry=http://registry.npm.taobao.org        #使用淘宝镜像
npm config get registry                                                             #查询当前镜像
npm config rm registry                                                              #删除自定义镜像,使用官方镜像
npm info express

屏蔽license

在源码根目录找到pom.xml文件并打开,然后查找“license-maven-plugin”内容后,并将整个plugin注释掉

mvn命令编译

1
mvn clean install -Dmaven.test.skip=true

经验总结

  1. 如果在编译过程中发现gradle的zip文件下载很慢可以手动下载后去对应目录解压,具体演示参见下图 image
  2. js-executor这一层项目npm install错误
    1
    
    Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:npm (npm install) on project js-executor: Failed to run task: 'npm install' failed.
    
    • 原因:本地缓存缺少fetched-v10.15.3-linux-x64和fetched-v10.15.3-win-x64这两个文件
    • 解决方法:前往github下载对应文件并重命名,下载地址:https://github.com/zeit/pkg-fetch/releases
    • 结果如下图: image
  3. 如果发现maven或者npm下载太慢的情况,建议多尝试几次,如果还是不行。建议放弃不要把时间浪费在这里,请把有限的精力放在其它工作中,晚上好好睡一觉,第二天早上6:00以前起床试一下,或许有惊喜。(如果你的网络特别糟糕,我只能说我尽力了)