blob: aca0b9f8f24dfd75ba800821d92d19c71838eb08 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
plugins {
id('java-library')
id('maven-publish')
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
maven(MavenPublication) {
from components.java
groupId project.group
artifactId "${archivesBaseName}"
version System.getenv("CODE_VERSION") ?: "${version}"
}
}
}
ext.dtestJar = System.getenv("DTEST_JAR") ?: "dtest-4.1.4.jar" // latest supported Cassandra build is 4.1
def dtestJarFullPath = "${dependencyLocation}${ext.dtestJar}"
test {
useJUnitPlatform()
}
dependencies {
// These dependencies (sidecar + dtest jars) must be built by running `scripts/build-dependencies.sh`
implementation(group: 'org.apache.cassandra.sidecar', name: 'adapters-base', version: "${sidecarVersion}")
implementation(group: 'org.apache.cassandra.sidecar', name: 'adapters-cassandra41', version: "${sidecarVersion}")
File dtestJarFile = new File(dtestJarFullPath)
println("Using DTest jar: " + dtestJarFullPath + "; present? " + dtestJarFile.exists())
// The dtest jar must be a compile only dependency. We want to avoid having this jar in the
// classpath while running integration tests. Instead, a dedicated classloader will load the
// dtest jar while provisioning the in-jvm dtest Cassandra cluster
compileOnly(files("${dtestJarFullPath}"))
api("org.apache.cassandra:dtest-api:0.0.16")
// Needed by the Cassandra dtest framework
// JUnit
api("org.junit.jupiter:junit-jupiter-api:${project.junitVersion}")
api("org.junit.jupiter:junit-jupiter-params:${project.junitVersion}")
api("org.junit.jupiter:junit-jupiter-engine:${project.junitVersion}")
api("org.junit.vintage:junit-vintage-engine:${junitVersion}")
api('org.mockito:mockito-inline:4.10.0')
api("org.assertj:assertj-core:3.24.2")
api('com.datastax.cassandra:cassandra-driver-core:3.11.3')
implementation('com.google.inject:guice:4.2.2')
implementation("com.google.guava:guava:27.0.1-jre")
api("io.vertx:vertx-web:${project.vertxVersion}") {
exclude group: 'junit', module: 'junit'
}
implementation("io.vertx:vertx-web-client:${project.vertxVersion}")
implementation(group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.14.3')
// Bouncycastle dependencies for test certificate provisioning
implementation(group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.78')
implementation(group: 'org.bouncycastle', name: 'bcpkix-jdk18on', version: '1.78')
testImplementation(platform("org.junit:junit-bom:${project.junitVersion}"))
testImplementation('org.junit.jupiter:junit-jupiter')
testImplementation("org.assertj:assertj-core:3.24.2")
// Exposed to the test project
api("io.vertx:vertx-junit5:${project.vertxVersion}")
// The server itself
api(group: "org.apache.cassandra", name: "cassandra-sidecar", version: "${sidecarVersion}") {
exclude(group: 'org.apache.logging.log4j')
exclude(group: 'org.slf4j')
exclude(group: 'ch.qos.logback')
}
api(group: 'org.apache.cassandra.sidecar', name: 'server-common', version: "${sidecarVersion}")
}