Skip to main content

Maven dependencies

TNB is distributed as Maven artifacts hosted on Maven Central. There are multiple ways to add TNB to your project depending on your needs.

Using individual services

Add specific service dependencies for the services you want to test:
pom.xml
<dependency>
    <groupId>software.tnb</groupId>
    <artifactId>system-x-kafka</artifactId>
    <version>1.0-SNAPSHOT</version>
    <scope>test</scope>
</dependency>
This is the recommended approach as it only includes the services you actually use.

Available service artifacts

TNB provides artifacts for each System-X service. Common examples include:
<!-- Kafka -->
<dependency>
    <groupId>software.tnb</groupId>
    <artifactId>system-x-kafka</artifactId>
    <version>1.0-SNAPSHOT</version>
    <scope>test</scope>
</dependency>

<!-- RabbitMQ -->
<dependency>
    <groupId>software.tnb</groupId>
    <artifactId>system-x-rabbitmq</artifactId>
    <version>1.0-SNAPSHOT</version>
    <scope>test</scope>
</dependency>

<!-- AMQ -->
<dependency>
    <groupId>software.tnb</groupId>
    <artifactId>system-x-amq</artifactId>
    <version>1.0-SNAPSHOT</version>
    <scope>test</scope>
</dependency>

Using the BOM

For easier dependency management, import the TNB BOM (Bill of Materials):
pom.xml
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>software.tnb</groupId>
            <artifactId>bom</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <!-- No version needed when using BOM -->
    <dependency>
        <groupId>software.tnb</groupId>
        <artifactId>system-x-kafka</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>
The BOM manages versions for all TNB artifacts, ensuring compatibility.

Using all services

For comprehensive testing scenarios, you can include all System-X services:
pom.xml
<dependency>
    <groupId>software.tnb</groupId>
    <artifactId>system-x-all</artifactId>
    <version>1.0-SNAPSHOT</version>
    <scope>test</scope>
</dependency>
This includes 50+ services and their dependencies. Only use this if you need access to most services. Otherwise, include individual service artifacts.

Camel testing

For testing Apache Camel applications, add the fuse-products module:
pom.xml
<dependency>
    <groupId>software.tnb</groupId>
    <artifactId>fuse-products</artifactId>
    <version>1.0-SNAPSHOT</version>
    <scope>test</scope>
</dependency>
This provides utilities for:
  • Generating Camel routes from Java DSL
  • Testing Camel integrations
  • Deploying Camel applications on OpenShift

Project requirements

Java version

TNB requires Java 17 or higher:
pom.xml
<properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
</properties>

JUnit 5

TNB is built on JUnit 5. Make sure your project includes:
pom.xml
<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter</artifactId>
    <version>5.10.0</version>
    <scope>test</scope>
</dependency>

TestContainers

For local service deployment, TNB uses TestContainers. No explicit dependency is needed - it’s included transitively. Requirements:
  • Docker installed and running
  • Docker socket accessible by your user

OpenShift (optional)

For OpenShift deployment:
  • Access to an OpenShift cluster
  • oc CLI tool configured
  • Valid kubeconfig with cluster credentials

Maven Surefire configuration

Configure the Surefire plugin to run tests:
pom.xml
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.5.0</version>
        </plugin>
    </plugins>
</build>

Repository configuration

For snapshot versions, add the Sonatype snapshot repository:
pom.xml
<repositories>
    <repository>
        <id>sonatype-snapshots</id>
        <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>
Release versions are available on Maven Central and don’t require repository configuration.

Complete example

Here’s a complete pom.xml for a TNB test project:
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
         http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>my-integration-tests</artifactId>
    <version>1.0.0</version>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>software.tnb</groupId>
                <artifactId>bom</artifactId>
                <version>1.0-SNAPSHOT</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- TNB services -->
        <dependency>
            <groupId>software.tnb</groupId>
            <artifactId>system-x-kafka</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>software.tnb</groupId>
            <artifactId>system-x-postgresql</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- JUnit 5 -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.10.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.0</version>
            </plugin>
        </plugins>
    </build>
</project>

Next steps

Quick start

Create your first TNB test

Available services

Browse all supported System-X services

Configuration

Configure service images and credentials

Core concepts

Learn about the TNB architecture

Build docs developers (and LLMs) love