Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 27 additions & 52 deletions Jenkinsfile-datastax
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,24 @@ def initializeEnvironment() {
env.PATH = "${env.MAVEN_HOME}/bin:${env.PATH}"

/*
* As of JAVA-3042 JAVA_HOME is always set to JDK8 and this is currently necessary for mvn compile and DSE Search/Graph.
* To facilitate testing with JDK11/17 we feed the appropriate JAVA_HOME into the maven build via commandline.
*
* Maven command-line flags:
* - -DtestJavaHome=/path/to/java/home: overrides JAVA_HOME for surefire/failsafe tests, defaults to environment JAVA_HOME.
* - -Ptest-jdk-N: enables profile for running tests with a specific JDK version (substitute N for 8/11/17).
*
* Note test-jdk-N is also automatically loaded based off JAVA_HOME SDK version so testing with an older SDK is not supported.
* JAVA_HOME is always set to the specified runtime JDK (i.e. whatever is in JABBA_VERSION). This covers all Maven
* invocations. Actual tests run by Maven's surefire/failsafe plugin will be managed via test testJavaHome param.
*
* Environment variables:
* - JAVA_HOME: Path to JDK used for mvn (all steps except surefire/failsafe), Cassandra, DSE.
* - JAVA8_HOME: Path to JDK8 used for Cassandra/DSE if ccm determines JAVA_HOME is not compatible with the chosen backend.
* - TEST_JAVA_HOME: PATH to JDK used for surefire/failsafe testing.
* - TEST_JAVA_VERSION: TEST_JAVA_HOME SDK version number [8/11/17], used to configure test-jdk-N profile in maven (see above)
* - JAVA_HOME: Path to JDK used for mvn. ccm may use this if applicable, otherwise it falls back to JAVA8_HOME and JAVA11_HOME
* for older Cassandra/DSE/HCD instances.
* - JAVA8_HOME: Path to JDK8 used for Cassandra/DSE if ccm determines JAVA_HOME is not compatible with the chosen backend
* - JAVA11_HOME: Similar to JAVA8_HOME for Java11
*/

env.JAVA_HOME = sh(label: 'Get JAVA_HOME',script: '''#!/bin/bash -le
. ${JABBA_SHELL}
jabba which ${JABBA_VERSION}''', returnStdout: true).trim()
env.JAVA8_HOME = sh(label: 'Get JAVA8_HOME',script: '''#!/bin/bash -le
env.JAVA8_HOME = sh(label: 'Get JAVA8_HOME (in case ccm needs it)',script: '''#!/bin/bash -le
. ${JABBA_SHELL}
jabba which 1.8''', returnStdout: true).trim()
env.JAVA11_HOME = sh(label: 'Get JAVA11_HOME (in case ccm needs it)',script: '''#!/bin/bash -le
. ${JABBA_SHELL}
jabba which openjdk@11''', returnStdout: true).trim()

sh label: 'Download Apache CassandraⓇ, DataStax Enterprise or DataStax HCD ',script: '''#!/bin/bash -le
. ${JABBA_SHELL}
Expand Down Expand Up @@ -88,32 +84,31 @@ ENVIRONMENT_EOF
'''
}

sh label: 'Display Java and environment information',script: '''#!/bin/bash -le
sh label: 'Display Java and environment information for Maven',script: '''#!/bin/bash -le
# Load CCM environment variables
set -o allexport
. ${HOME}/environment.txt
set +o allexport

. ${JABBA_SHELL}
jabba use 1.8
jabba use ${JABBA_VERSION}

java -version
mvn -v
printenv | sort
'''
}

def buildDriver(jabbaVersion) {
def buildDriverScript = '''#!/bin/bash -le
def buildDriver() {
sh label: 'Build driver', script: '''#!/bin/bash -le

. ${JABBA_SHELL}
jabba use '''+jabbaVersion+'''
jabba use ${BUILD_JAVA_VERSION}

echo "Building with Java version '''+jabbaVersion+'''"
echo "Building with Java version ${BUILD_JAVA_VERSION}"

mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
'''
sh label: 'Build driver', script: buildDriverScript
}

def executeTests() {
Expand All @@ -129,13 +124,7 @@ def executeTests() {
set +o allexport

. ${JABBA_SHELL}
jabba use 1.8

if [ "${JABBA_VERSION}" != "1.8" ]; then
SKIP_JAVADOCS=true
else
SKIP_JAVADOCS=false
fi
jabba use ${BUILD_JAVA_VERSION}

INTEGRATION_TESTS_FILTER_ARGUMENT=""
if [ ! -z "${INTEGRATION_TESTS_FILTER}" ]; then
Expand All @@ -144,14 +133,12 @@ def executeTests() {
printenv | sort

mvn -B -V ${INTEGRATION_TESTS_FILTER_ARGUMENT} -T 1 verify \
-Ptest-jdk-'''+testJavaVersion+''' \
-DtestJavaHome='''+testJavaHome+''' \
-DfailIfNoTests=false \
-Dmaven.test.failure.ignore=true \
-Dmaven.javadoc.skip=${SKIP_JAVADOCS} \
-Dmaven.javadoc.skip=true \
-Dccm.version=${CCM_CASSANDRA_VERSION} \
-Dccm.distribution=${CCM_SERVER_TYPE:cassandra} \
-Dproxy.path=${HOME}/proxy \
${SERIAL_ITS_ARGUMENT} \
${ISOLATED_ITS_ARGUMENT} \
${PARALLELIZABLE_ITS_ARGUMENT}
Expand Down Expand Up @@ -329,10 +316,8 @@ pipeline {
choice(
name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_JABBA_VERSION',
choices: [
'1.8', // Oracle JDK version 1.8 (current default)
'openjdk@1.11', // OpenJDK version 11
'openjdk@1.17', // OpenJDK version 17
'openjdk@1.21' // OpenJDK version 21
'openjdk@21' // OpenJDK version 21
],
description: '''JDK version to use for <b>TESTING</b> when running adhoc <b>BUILD-AND-EXECUTE-TESTS</b> builds. <i>All builds will use JDK8 for building the driver</i>
<table style="width:100%">
Expand All @@ -342,20 +327,12 @@ pipeline {
<th align="left">Choice</th>
<th align="left">Description</th>
</tr>
<tr>
<td><strong>1.8</strong></td>
<td>Oracle JDK version 1.8 (<i>Used for compiling regardless of choice</i>)</td>
</tr>
<tr>
<td><strong>openjdk@1.11</strong></td>
<td>OpenJDK version 11</td>
</tr>
<tr>
<td><strong>openjdk@1.17</strong></td>
<td>OpenJDK version 17</td>
</tr>
<tr>
<td><strong>openjdk@1.21</strong></td>
<td><strong>openjdk@21</strong></td>
<td>OpenJDK version 21</td>
</tr>
</table>''')
Expand Down Expand Up @@ -394,16 +371,16 @@ pipeline {
// schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.)
parameterizedCron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? """
# Every weekend (Saturday, Sunday) around 2:00 AM
H 2 * * 0 %CI_SCHEDULE=WEEKENDS;CI_SCHEDULE_SERVER_VERSIONS=4.0 4.1 5.0 dse-4.8.16 dse-5.0.15 dse-5.1.35 dse-6.0.18 dse-6.7.17;CI_SCHEDULE_JABBA_VERSION=1.8
H 2 * * 0 %CI_SCHEDULE=WEEKENDS;CI_SCHEDULE_SERVER_VERSIONS=4.0 4.1 5.0 dse-4.8.16 dse-5.0.15 dse-5.1.35 dse-6.0.18 dse-6.7.17;CI_SCHEDULE_JABBA_VERSION=openjdk@1.17
# Every weeknight (Monday - Friday) around 12:00 PM noon
H 12 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=4.1 5.0 dse-6.8.30 dse-6.9.0 hcd-1.0.0;CI_SCHEDULE_JABBA_VERSION=openjdk@1.11
H 12 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=4.1 5.0 dse-6.8.30 dse-6.9.0 hcd-1.0.0;CI_SCHEDULE_JABBA_VERSION=openjdk@1.17
""" : "")
}

environment {
OS_VERSION = 'ubuntu/focal64/java-driver'
JABBA_SHELL = '/usr/lib/jabba/jabba.sh'
BUILD_JAVA_VERSION = "openjdk@1.17"
CCM_ENVIRONMENT_SHELL = '/usr/local/bin/ccm_environment.sh'
SERIAL_ITS_ARGUMENT = "-DskipSerialITs=${params.SKIP_SERIAL_ITS}"
ISOLATED_ITS_ARGUMENT = "-DskipIsolatedITs=${params.SKIP_ISOLATED_ITS}"
Expand Down Expand Up @@ -439,10 +416,8 @@ pipeline {
}
axis {
name 'JABBA_VERSION'
values '1.8', // jdk8
'openjdk@1.11', // jdk11
'openjdk@1.17', // jdk17
'openjdk@1.21' // jdk21
values 'openjdk@1.17', // jdk17
'openjdk@21' // jdk21
}
}

Expand All @@ -468,7 +443,7 @@ pipeline {
}
stage('Build-Driver') {
steps {
buildDriver('1.8')
buildDriver()
}
}
stage('Execute-Tests') {
Expand Down Expand Up @@ -583,7 +558,7 @@ pipeline {
}
stage('Build-Driver') {
steps {
buildDriver('1.8')
buildDriver()
}
}
stage('Execute-Tests') {
Expand Down Expand Up @@ -611,7 +586,7 @@ pipeline {
when {
allOf {
environment name: 'SERVER_VERSION', value: '4.0'
environment name: 'JABBA_VERSION', value: '1.8'
environment name: 'JABBA_VERSION', value: 'openjdk@1.17'
}
}
steps {
Expand Down
20 changes: 10 additions & 10 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-bom</artifactId>
<packaging>pom</packaging>
Expand All @@ -33,47 +33,47 @@
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-core</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-core-shaded</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-mapper-processor</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-mapper-runtime</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-query-builder</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-guava-shaded</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-test-infra</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-metrics-micrometer</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-metrics-microprofile</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.datastax.oss</groupId>
Expand Down
2 changes: 1 addition & 1 deletion core-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-core-shaded</artifactId>
<name>Apache Cassandra Java Driver - core with shaded deps</name>
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-core</artifactId>
<packaging>bundle</packaging>
Expand Down
2 changes: 1 addition & 1 deletion distribution-source/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-distribution-source</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion distribution-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-distribution-tests</artifactId>
<name>Apache Cassandra Java Driver - distribution tests</name>
Expand Down
2 changes: 1 addition & 1 deletion distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-distribution</artifactId>
<!-- Should be pom but Javadoc generation requires a "classpath-capable" package -->
Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>java-driver-parent</artifactId>
<groupId>org.apache.cassandra</groupId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-examples</artifactId>
<name>Apache Cassandra Java Driver - examples.</name>
Expand Down
2 changes: 1 addition & 1 deletion guava-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-guava-shaded</artifactId>
<name>Apache Cassandra Java Driver - guava shaded dep</name>
Expand Down
13 changes: 12 additions & 1 deletion integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.19.4-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-integration-tests</artifactId>
<packaging>jar</packaging>
Expand Down Expand Up @@ -326,6 +326,17 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-mapper-processor</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
Expand Down
Loading