- Required tools
- Source code
- Build
- Build local docker images
- Build artifacts
- Running tests
- Tips and tricks
This guide will help you to download and build TBMQ from sources. Instructions listed below are tested on Ubuntu 20.04 LTS.
Required tools
This section contains installation instructions for build tools.
Java
TBMQ is build using Java 17. Follow these instructions to install OpenJDK 17:
1
2
sudo apt update
sudo apt install openjdk-17-jdk
Please don’t forget to configure your operating system to use OpenJDK 17 by default. You can configure which version is the default using the following command:
1
sudo update-alternatives --config java
You can check the installation using the following command:
1
java -version
Expected command output is:
1
2
3
openjdk version "17.0.xx"
OpenJDK Runtime Environment (...)
OpenJDK 64-Bit Server VM (build ...)
Maven
TBMQ build requires Maven 3.6.3+.
1
sudo apt install maven
Please note that maven installation may set Java 7 as a default JVM on certain Linux machines. Use java installation instructions to fix this.
Source code
You can clone source code of the project from the official GitHub repo.
1
2
git clone -b release-2.0.0 https://github.com/thingsboard/tbmq.git
cd tbmq
Build
Run the following command from the TBMQ folder to build the project:
1
mvn clean install -DskipTests
Build local docker images
Make sure that Docker is installed.
1
mvn clean install -DskipTests -Ddockerfile.skip=false
Build artifacts
You can find debian, rpm and windows packages in the target folder:
1
cd application/target
Running tests
We are using Docker to run all kind of integration and black-box tests.
Please, manage Docker as a non-root user to run tests properly.
Main and release branches are already tested, so you can skip tests and avoid installing docker as well.
Run all unit and integration tests:
1
mvn clean install
Tips and tricks
TBMQ is quite easy to build from sources on a brand-new clear environment.
Here are some tips and tricks to boost build experience:
- clean maven cache
1
rm -rf ~/.m2/repository
- clean gradle cache
1
rm -rf ~/.gradle/caches/
- clean node modules
1
rm -rf ui-ngx/node_modules
- build in parallel, format headers, build docker images
1
mvn -T 0.8C license:format clean install -DskipTests -Ddockerfile.skip=false