Scylla Documentation Logo Documentation
  • Server
    • Scylla Open Source
    • Scylla Enterprise
    • Scylla Alternator
  • Cloud
    • Scylla Cloud
    • Scylla Cloud Docs
  • Tools
    • Scylla Manager
    • Scylla Monitoring Stack
    • Scylla Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
Download
Menu

Caution

You're viewing documentation for a previous version of Scylla Java Driver. Switch to the latest stable version.

Scylla Java Driver Manual Core driver Bill of Materials (BOM)

Bill of Materials (BOM)¶

A “Bill Of Materials” is a special Maven descriptor that defines the versions of a set of related artifacts.

To import the driver’s BOM, add the following section in your application’s own POM:

<project>
  ...
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.scylladb</groupId>
        <artifactId>java-driver-bom</artifactId>
        <version>4.7.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

This allows you to omit the version when you later reference the driver artifacts:

<project>
  ...
  <dependencies>
    <dependency>
      <groupId>com.scylladb</groupId>
      <artifactId>java-driver-query-builder</artifactId>
    </dependency>
  </dependencies>

The advantage is that this also applies to transitive dependencies. For example, if there is a third-party library X that depends on java-driver-core, and you add a dependency to X in this project, java-driver-core will be set to the BOM version, regardless of which version X declares in its POM. The driver artifacts are always in sync, however they were pulled into the project.

BOM and mapper processor¶

If you are using the driver’s object mapper, our recommendation is to declare the mapper processor in the annotationProcessorPaths section of the compiler plugin configuration. Unfortunately, <dependencyManagement> versions don’t work there, this is a known Maven issue (MCOMPILER-391).

As a workaround, you can either declare the mapper processor as a regular dependency in the provided scope:

  <dependencies>
    <dependency>
      <groupId>com.scylladb</groupId>
      <artifactId>java-driver-mapper-processor</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>

Or keep it in the compiler plugin, but repeat the version explicitly. In that case, it’s probably a good idea to extract a property to keep it in sync with the BOM:

<project>
  <properties>
    <java-driver.version>4.7.0</java-driver.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.scylladb</groupId>
        <artifactId>java-driver-bom</artifactId>
        <version>${java-driver.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <!-- Regular dependency, no need to repeat the version: -->
    <dependency>
      <groupId>com.scylladb</groupId>
      <artifactId>java-driver-mapper-runtime</artifactId>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <annotationProcessorPaths>
            <!-- Annotation processor, can't use the BOM => explicit version -->
            <path>
              <groupId>com.scylladb</groupId>
              <artifactId>java-driver-mapper-processor</artifactId>
              <version>${java-driver.version}</version>
            </path>
          </annotationProcessorPaths>
        </configuration>
      </plugin>
    </plugins>
  </build>
PREVIOUS
Authentication
NEXT
Compression
  • 4.7.2.x
    • 4.13.0.x
    • 4.12.0.x
    • 4.11.1.x
    • 4.10.0.x
    • 4.7.2.x
    • 3.11.2.x
    • 3.11.0.x
    • 3.10.2.x
    • 3.7.2.x
  • Java Driver for Scylla and Apache Cassandra®
  • API Documentation
  • Manual
    • API conventions
    • Case sensitivity
    • Core driver
      • Address resolution
      • Asynchronous programming
      • Authentication
      • Bill of Materials (BOM)
      • Compression
      • Configuration
        • Reference configuration
      • Control connection
      • Custom codecs
      • Detachable types
      • Query idempotence
      • Integration
      • Load balancing
      • Logging
      • Metadata
        • Node metadata
        • Schema metadata
        • Token metadata
      • Metrics
      • Native protocol
      • Paging
      • Performance
      • Connection pooling
      • Query timestamps
      • Reactive Style Programming
      • Reconnection
      • Request tracker
      • Retries
      • Using the shaded JAR
      • Speculative query execution
      • SSL
      • Statements
        • Batch statements
        • Per-query keyspace
        • Prepared statements
        • Simple statements
      • Temporal types
      • Request throttling
      • Query tracing
      • Tuples
      • User-defined types
    • Developer docs
      • Administrative tasks
      • Common infrastructure
        • Concurrency
        • Driver context
        • Event bus
      • Native protocol layer
      • Netty pipeline
      • Request execution
    • Mapper
      • Integration
      • DAOs
        • Custom result types
        • Delete methods
        • GetEntity methods
        • Insert methods
        • Null saving strategy
        • Query methods
        • Query provider methods
        • Select methods
        • SetEntity methods
        • Statement attributes
        • Update methods
      • Entities
      • Mapper interface
    • OSGi
    • Query builder
      • Conditions
      • DELETE
      • Idempotence in the query builder
      • INSERT
      • Relations
      • Schema builder
        • Aggregate
        • Function
        • Index
        • Keyspace
        • Materialized View
        • Table
        • Type
      • SELECT
      • Terms
      • TRUNCATE
      • UPDATE
  • Upgrade guide
  • Frequently asked questions
  • Changelog
  • Create an issue
  • Edit this page

On this page

  • Bill of Materials (BOM)
    • BOM and mapper processor
Logo
Docs Contact Us About Us
Mail List Icon Slack Icon
© 2022, ScyllaDB. All rights reserved.
Last updated on 25 May 2022.
Powered by Sphinx 4.3.2 & ScyllaDB Theme 1.2.2