Thingsboard物联网平台开发环境本地搭建
windows 10openJDK 11node.js yarn 稳定版即可。
·
Thingsboard物联网平台开发环境本地搭建
环境
windows 10
openJDK 11
maven >=3.6.1
gradle 8.0.2
node.js yarn 稳定版即可
PostgreSQL 13
环境配置文件
链接:https://pan.baidu.com/s/1PxKiWdp7y1ZgCcwfNvgbWw?pwd=h2vm
提取码:h2vm
首先从GitHub上拉取代码,可能需要开启vpn,也可以从gitee拉,但是github是必须要连的编译项目的时候会从github上下载文件,推荐vpn (watt toolkit)。
开了VPN后使用代理git可能会出错,在命令行运行如下命令即可
git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890
github:https://github.com/thingsboard/thingsboard.git
gitee: https://gitee.com/mirrors/ThingsBoard.git
为npm和yarn下载切换国内源
npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
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
编译
按照自己的node版本修改代码的指定内容,共三处
在C盘放入.pkg-cache文件夹,并在文件夹放入两个文件fetched-v16.15.0-linux-x64和fetched-v16.15.0-win-x64,如果不行可以试试其他版本下载地址是https://github.com/zeit/pkg-fetch/releases ,下载后需重命名。
配置maven镜像
<mirror>
<id>public</id>
<name>aliyun public</name>
<url>https://maven.aliyun.com/repository/public</url>
<mirrorOf>public</mirrorOf>
</mirror>
<mirror>
<id>central</id>
<name>aliyun central</name>
<url>https://maven.aliyun.com/repository/central</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>google</id>
<name>aliyun google</name>
<url>https://maven.aliyun.com/repository/google</url>
<mirrorOf>google</mirrorOf>
</mirror>
<mirror>
<id>gradle-plugin</id>
<name>aliyun gradle-plugin</name>
<url>https://maven.aliyun.com/repository/gradle-plugin</url>
<mirrorOf>gradle-plugin</mirrorOf>
</mirror>
<mirror>
<id>spring</id>
<name>aliyun spring</name>
<url>https://maven.aliyun.com/repository/spring</url>
<mirrorOf>spring</mirrorOf>
</mirror>
<mirror>
<id>spring-plugin</id>
<name>aliyun spring-plugin</name>
<url>https://maven.aliyun.com/repository/spring-plugin</url>
<mirrorOf>spring-plugin</mirrorOf>
</mirror>
<mirror>
<id>grails-core</id>
<name>aliyun grails-core</name>
<url>https://maven.aliyun.com/repository/grails-core</url>
<mirrorOf>grails-core</mirrorOf>
</mirror>
<mirror>
<id>apache-snapshots</id>
<name>aliyun apache-snapshots</name>
<url>https://maven.aliyun.com/repository/apache-snapshots</url>
<mirrorOf>apache-snapshots</mirrorOf>
</mirror>
<mirror>
<id>jcenter</id>
<name>aliyun jcenter</name>
<url>https://maven.aliyun.com/repository/jcenter</url>
<mirrorOf>jcenter</mirrorOf>
</mirror>
<mirror>
<id>releases</id>
<name>aliyun releases</name>
<url>https://maven.aliyun.com/repository/releases</url>
<mirrorOf>releases</mirrorOf>
</mirror>
<mirror>
<id>snapshots</id>
<name>aliyun snapshots</name>
<url>https://maven.aliyun.com/repository/snapshots</url>
<mirrorOf>snapshots</mirrorOf>
</mirror>
<mirror>
<id>mapr-public</id>
<name>aliyun mapr-public</name>
<url>https://maven.aliyun.com/repository/mapr-public</url>
<mirrorOf>mapr-public</mirrorOf>
</mirror>
<mirror>
<id>staging-alpha</id>
<name>aliyun staging-alpha</name>
<url>https://maven.aliyun.com/repository/staging-alpha</url>
<mirrorOf>staging-alpha</mirrorOf>
</mirror>
<mirror>
<id>staging-alpha-group</id>
<name>aliyun staging-alpha-group</name>
<url>https://maven.aliyun.com/repository/staging-alpha-group</url>
<mirrorOf>staging-alpha-group</mirrorOf>
</mirror>
编译,在项目文件夹下执行 mvn clean install -DskipTests
IDEA 配置JDK
生成并初始化数据表
更改数据库名,账户名,密码
必须保证有该数据库,不然运行时会报错
配置ThingsboardInstallApplication参数,路径配置到application的data文件夹。
转移SQL文件,将dao模块下resources下的sql文件夹复制到application下data文件夹下
运行
更多推荐
已为社区贡献1条内容
所有评论(0)