Building from source
This guide covers downloading and building TBMQ from source. Instructions are tested on Ubuntu 20.04 LTS, 22.04 LTS, and 24.04 LTS.
Required tools
Section titled “Required tools”This section describes the build tools required to compile TBMQ from source.
TBMQ is built using Java 17. Install OpenJDK 17:
sudo apt updatesudo apt install openjdk-17-jdk-headlessConfigure your operating system to use OpenJDK 17 by default. Set the default version with the following command:
sudo update-alternatives --config javaVerify the installation:
java -versionExpected output:
openjdk version "17.0.xx"OpenJDK Runtime Environment (...)OpenJDK 64-Bit Server VM (build ...)TBMQ requires Maven 3.6.3 or later:
sudo apt install mavenSource code
Section titled “Source code”Clone the repository from the official GitHub repo:
git clone -b release-2.3.0 https://github.com/thingsboard/tbmq.gitcd tbmqFrom the tbmq directory, build the project:
mvn clean install -DskipTestsBuild local Docker images
Section titled “Build local Docker images”Make sure Docker is installed, then run:
mvn clean install -DskipTests -Ddockerfile.skip=falseBuild artifacts
Section titled “Build artifacts”Debian, RPM, and Windows packages are located in the target folder:
cd application/targetRunning tests
Section titled “Running tests”Docker is required to run integration and black-box tests. Make sure your user can run Docker without root.
Run all unit and integration tests:
mvn clean installTips and tricks
Section titled “Tips and tricks”Common fixes for build issues:
-
Clean Maven cache:
Terminal window rm -rf ~/.m2/repository -
Clean Gradle cache:
Terminal window rm -rf ~/.gradle/caches/ -
Clean node modules:
Terminal window rm -rf ui-ngx/node_modules -
Build in parallel, format license headers, and build Docker images:
Terminal window mvn -T 0.8C license:format clean install -DskipTests -Ddockerfile.skip=false