#查询当前镜像
npm config get registry
-
安装yarn
npm安装yarn:npm install -g yarn
#设置淘宝镜像:
yarn config set registry https://registry.npm.taobao.org -g
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g
#使用yarn config list查看,发现的新版的yarn是严格检查ssl的,关闭严格检查SSL设置
yarn config set strict-ssl false -
安装PostgreSQL,使用PostgreSQL 12.X及以上版本
#参考地址:https://www.cnblogs.com/wenhuang/p/10706931.html
## 2.获取源码,修改配置、代码
-
拉取源码:git clone https://gitee.com/mirrors/ThingsBoard.git
-
切换分支:git checkout release-3.6
-
注释、修改配置文件
3.1 根目录pom.xml文件找到license-maven-plugin,并将整个plugin注释掉
3.2 application模块中的thingsboard.yml文件修改数据库相关信息
3.3 ui-ngx模块中的pom.xml文件修改node/yarn版本号
3.4 msa/js-executor模块中的pom.xml文件修改node/yarn版本号 -
启动时异常处理:Error creating bean with name ‘defaultTbMailConfigTemplateService’: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [templates/mail_config_templates.json] cannot be resolved to absolute file path because it does not reside in the file system:
解决方式:
1. 修改类org.thingsboard.server.service.mail.DefaultTbMailConfigTemplateService.java文件获取模板文件方法
原方法:mailConfigTemplates = JacksonUtil.toJsonNode(new ClassPathResource(“/templates/mail_config_templates.json”).getFile());
调整为: