Dependency management

A specific Camel Quarkus release is supposed to work only with a specific Quarkus release.

Quarkus Universe BOM

The easiest and most straightforward way to get the dependency versions right is to use code.quarkus.io. It will produce a project with the io.quarkus:quarkus-universe-bom set up in the <depependencyManagement> section of your pom.xml file.

BOM stands for "Bill of Materials" - it is a pom.xml whose main purpose is to manage the versions of artifacts so that end users importing the BOM in their projects do not need to care which particular versions of the artifacts are supposed to work together. In other words, having a BOM imported in the <depependencyManagement> section of your pom.xml allows you to avoid specifying versions for the dependencies managed by the given BOM.

quarkus-universe-bom manages the artifacts from Quarkus, Camel Quarkus and other participating projects, such as Hazelcast, Cassandra, Kogito, Optaplanner, etc.

This has the advantage that application developers do not need to care for the compatibility of the individual artifacts that may come from various independent projects. Note that not all combinations of artifacts managed by quarkus-universe-bom are tested.

Here is a stub of a pom.xml file generated by code.quarkus.io:

<project>
  ...
  <properties>
    <quarkus.platform.version>2.1.0.Final</quarkus.platform.version>
    ...
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-universe-bom</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope><!-- The BOM is imported in the <dependencyManagement> -->
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.apache.camel.quarkus</groupId>
      <artifactId>camel-quarkus-timer</artifactId>
      <!-- No explicit version required here and below -->
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel.quarkus</groupId>
      <artifactId>camel-quarkus-ftp</artifactId>
    </dependency>
    ...
  </dependencies>
  ...
</project>

Camel Quarkus BOM

As long as you do not plan to use any dependencies beyond those from Quarkus and Camel Quarkus, you may consider switching to org.apache.camel.quarkus:camel-quarkus-bom. It manages all supported Camel artifacts and imports io.quarkus:quarkus-bom.

io.quarkus:quarkus-bom manages the core Quarkus dependencies, such as io.quarkus:quarkus-arc (CDI), io.quarkus:quarkus-hibernate-orm, io.quarkus:quarkus-resteasy (JAX-RS), etc.

Combining with other BOMs

When combining camel-quarkus-bom or quarkus-universe-bom with any other BOM, think carefully in which order you import them, because the order of imports defines the precedence.

I.e. if my-foo-bom is imported before camel-quarkus-bom then the versions defined in my-foo-bom will take the precedence. This might or might not be what you want, depending on whether there are any overlaps between my-foo-bom and camel-quarkus-bom and depending on whether those versions with higher precedence work with the rest of the artifacts managed in camel-quarkus-bom.

What’s next?

We recommend to continue with Defining routes.