Using the shaded JAR

The default driver JAR depends on Netty, which is used internally for networking.

The driver is compatible with all Netty versions in the range [4.1.7, 4.2.0), that is, it can work with any version equal to or higher than 4.1.7, and lesser than 4.2.0.

This explicit dependency can be a problem if your application already uses another Netty version. To avoid conflicts, we provide a “shaded” version of the JAR, which bundles the Netty classes under a different package name:

<dependency>
  <groupId>com.datastax.oss</groupId>
  <artifactId>java-driver-core-shaded</artifactId>
  <version>${driver.version}</version>
</dependency>

If you also use the query-builder or some other library that depends on java-driver-core, you need to remove its dependency to the non-shaded JAR:

<dependency>
  <groupId>com.datastax.oss</groupId>
  <artifactId>java-driver-core-shaded</artifactId>
  <version>${driver.version}</version>
</dependency>
<dependency>
  <groupId>com.datastax.oss</groupId>
  <artifactId>java-driver-query-builder</artifactId>
  <version>${driver.version}</version>
  <exclusions>
    <exclusion>
      <groupId>com.datastax.oss</groupId>
      <artifactId>java-driver-core</artifactId>
    </exclusion>
  </exclusions>
</dependency>