Skip to content
Stand with Ukraine flag

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.

This section describes the build tools required to compile TBMQ from source.

TBMQ is built using Java 17. Install OpenJDK 17:

Terminal window
sudo apt update
sudo apt install openjdk-17-jdk-headless

Configure your operating system to use OpenJDK 17 by default. Set the default version with the following command:

Terminal window
sudo update-alternatives --config java

Verify the installation:

Terminal window
java -version

Expected output:

openjdk version "17.0.xx"
OpenJDK Runtime Environment (...)
OpenJDK 64-Bit Server VM (build ...)

TBMQ requires Maven 3.6.3 or later:

Terminal window
sudo apt install maven

Clone the repository from the official GitHub repo:

Terminal window
git clone -b release-2.3.0 https://github.com/thingsboard/tbmq.git
cd tbmq

From the tbmq directory, build the project:

Terminal window
mvn clean install -DskipTests

Make sure Docker is installed, then run:

Terminal window
mvn clean install -DskipTests -Ddockerfile.skip=false

Debian, RPM, and Windows packages are located in the target folder:

Terminal window
cd application/target

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:

Terminal window
mvn clean install

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