Skip to content

Commit

Permalink
Migrate to org.apache.cassandra:java-driver-bom
Browse files Browse the repository at this point in the history
... and bump to latest version 4.18.1

This change also adds build functionality to _replace_ the `java-driver-core` artifact with the Apache C* group ID and use that version. Also adds `org.apache.cassandra:java-driver-bom` as an `enforcedPlatform` to `:nessie-quarkus-common`, so we'd get notified (build errors), if other dependencies, like the shaded Guava, change.
  • Loading branch information
snazy committed Nov 25, 2024
1 parent 63d9e37 commit bd6c655
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 5 deletions.
14 changes: 14 additions & 0 deletions build-logic/src/main/kotlin/Utilities.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.withType
import org.gradle.process.JavaForkOptions

fun Project.cassandraDriverTweak() {
configurations.all {
resolutionStrategy {
eachDependency {
if (requested.module.toString() == "com.datastax.oss:java-driver-core") {
var libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
val cstarVersion = libs.findLibrary("cassandra-driver-bom").get().get().version
useTarget("org.apache.cassandra:java-driver-core:$cstarVersion")
}
}
}
}
}

/**
* dnsjava adds itself as the DNS resolver for the whole JVM, which is not something we want in
* Nessie.
Expand Down
2 changes: 2 additions & 0 deletions events/quarkus/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ plugins {

publishingHelper { mavenName = "Nessie - Events - Quarkus" }

cassandraDriverTweak()

dependencies {
implementation(project(":nessie-versioned-spi"))
implementation(project(":nessie-events-api"))
Expand Down
2 changes: 2 additions & 0 deletions events/ri/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ plugins {

extra["maven.name"] = "Nessie - Events - SPI Reference Implementation"

cassandraDriverTweak()

dependencies {
implementation(project(":nessie-model"))
implementation(project(":nessie-events-api"))
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ awssdk-bom = { module = "software.amazon.awssdk:bom", version = "2.29.20" }
azuresdk-bom = { module = "com.azure:azure-sdk-bom", version = "1.2.29" }
bouncycastle-bcpkix = { module = "org.bouncycastle:bcpkix-jdk15on", version.ref = "bouncycastle" }
bouncycastle-bcprov = { module = "org.bouncycastle:bcprov-jdk15on", version.ref = "bouncycastle" }
cassandra-driver-bom = { module = "com.datastax.oss:java-driver-bom", version = "4.17.0" }
cassandra-driver-bom = { module = "org.apache.cassandra:java-driver-bom", version = "4.18.1" }
caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version = "3.1.8" }
cel-bom = { module = "org.projectnessie.cel:cel-bom", version = "0.5.1" }
checkstyle = { module = "com.puppycrawl.tools:checkstyle", version.ref = "checkstyle" }
Expand Down
3 changes: 3 additions & 0 deletions servers/quarkus-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ plugins { id("nessie-conventions-quarkus") }

publishingHelper { mavenName = "Nessie - Quarkus Common" }

cassandraDriverTweak()

dependencies {
implementation(project(":nessie-model"))
implementation(project(":nessie-rest-common"))
Expand Down Expand Up @@ -67,6 +69,7 @@ dependencies {
implementation(enforcedPlatform(libs.quarkus.google.cloud.services.bom))
implementation("io.quarkiverse.googlecloudservices:quarkus-google-cloud-bigtable")
implementation(enforcedPlatform(libs.quarkus.cassandra.bom))
implementation(enforcedPlatform(libs.cassandra.driver.bom))
implementation("com.datastax.oss.quarkus:cassandra-quarkus-client") {
// spotbugs-annotations has only a GPL license!
exclude("com.github.spotbugs", "spotbugs-annotations")
Expand Down
2 changes: 2 additions & 0 deletions servers/quarkus-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ val versionIceberg = libs.versions.iceberg.get()

dnsjavaDowngrade()

cassandraDriverTweak()

dependencies {
implementation(project(":nessie-client"))
implementation(project(":nessie-model"))
Expand Down
2 changes: 2 additions & 0 deletions tools/server-admin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ val quarkusRunner by
description = "Used to reference the generated runner-jar (either fast-jar or uber-jar)"
}

cassandraDriverTweak()

dependencies {
implementation(project(":nessie-quarkus-common"))
implementation(project(":nessie-quarkus-config"))
Expand Down
2 changes: 1 addition & 1 deletion versioned/storage/cassandra-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
annotationProcessor(libs.immutables.value.processor)

implementation(platform(libs.cassandra.driver.bom))
implementation("com.datastax.oss:java-driver-core")
implementation("org.apache.cassandra:java-driver-core")

implementation(platform(libs.testcontainers.bom))
implementation("org.testcontainers:cassandra") {
Expand Down
2 changes: 1 addition & 1 deletion versioned/storage/cassandra/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {
implementation(libs.slf4j.api)

implementation(platform(libs.cassandra.driver.bom))
implementation("com.datastax.oss:java-driver-core") {
implementation("org.apache.cassandra:java-driver-core") {
// spotbugs-annotations has only a GPL license!
exclude("com.github.spotbugs", "spotbugs-annotations")
}
Expand Down
2 changes: 1 addition & 1 deletion versioned/storage/cassandra2-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
annotationProcessor(libs.immutables.value.processor)

implementation(platform(libs.cassandra.driver.bom))
implementation("com.datastax.oss:java-driver-core")
implementation("org.apache.cassandra:java-driver-core")

implementation(platform(libs.testcontainers.bom))
implementation("org.testcontainers:cassandra") {
Expand Down
2 changes: 1 addition & 1 deletion versioned/storage/cassandra2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {
implementation(libs.slf4j.api)

implementation(platform(libs.cassandra.driver.bom))
implementation("com.datastax.oss:java-driver-core") {
implementation("org.apache.cassandra:java-driver-core") {
// spotbugs-annotations has only a GPL license!
exclude("com.github.spotbugs", "spotbugs-annotations")
}
Expand Down

0 comments on commit bd6c655

Please sign in to comment.