Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 May 2023 21:25:49 GMT
From:      Guido Falsi <madpilot@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 678ef46e3abc - main - databases/cassandra4: Update to 4.0.8
Message-ID:  <202305152125.34FLPn6Z033393@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by madpilot:

URL: https://cgit.FreeBSD.org/ports/commit/?id=678ef46e3abc2e8d6720bbb2eb60002294975cdf

commit 678ef46e3abc2e8d6720bbb2eb60002294975cdf
Author:     Lapo Luchini <lapo@lapo.it>
AuthorDate: 2023-05-15 21:23:57 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2023-05-15 21:23:57 +0000

    databases/cassandra4: Update to 4.0.8
    
    - Add pre-fetch target to download Maven dependencies to avoid
      network access during build
    
    PR:             265478
    Approved by:    Angelo Polo <language.devel@gmail.com> (maintainer)
---
 databases/cassandra4/Makefile                      |   52 +-
 databases/cassandra4/distinfo                      |   18 +-
 databases/cassandra4/files/cassandra.in            |    9 +-
 databases/cassandra4/files/maven/build-owasp.xml   |   86 +
 databases/cassandra4/files/maven/build-rat.xml     |  105 +
 .../cassandra4/files/maven/build-resolver.xml      |  262 +++
 .../files/maven/build.properties.default           |    4 +
 databases/cassandra4/files/maven/build.xml         | 2174 ++++++++++++++++++++
 databases/cassandra4/files/patch-bin_cqlsh         |   11 +
 databases/cassandra4/files/patch-build.xml         |  179 +-
 .../cassandra4/files/patch-conf_cassandra.yaml     |   19 +-
 databases/cassandra4/files/patch-doc_Makefile      |   23 -
 .../patch-doc_source___templates_indexcontent.html |   17 -
 .../files/patch-doc_source___util_cql.py           |   10 -
 ...rc_java_org_apache_cassandra_config_Config.java |    4 +-
 ...e_cassandra_service_NativeTransportService.java |    4 +-
 ...org_apache_cassandra_service_StartupChecks.java |    2 +-
 ..._apache_cassandra_utils_FastByteOperations.java |   24 +-
 .../files/patch-test_conf_cassandra-murmur.yaml    |   10 +
 .../files/patch-test_conf_cassandra-seeds.yaml     |   10 +
 ...-test_conf_unit-test-conf_test-native-port.yaml |   10 +
 databases/cassandra4/pkg-plist                     |  114 +-
 22 files changed, 2840 insertions(+), 307 deletions(-)

diff --git a/databases/cassandra4/Makefile b/databases/cassandra4/Makefile
index a4ee9f37723d..d0407995fabe 100644
--- a/databases/cassandra4/Makefile
+++ b/databases/cassandra4/Makefile
@@ -1,16 +1,16 @@
 PORTNAME=	cassandra
-DISTVERSION=	4.0-beta2
+DISTVERSION=	4.0.8
 CATEGORIES=	databases java
 MASTER_SITES=	https://archive.apache.org/dist/${PORTNAME}/${DISTVERSION}/:apache \
-		https://repo1.maven.org/maven2/com/github/luben/zstd-jni/1.4.5-4/:maven \
-		LOCAL/mikael:repo
+		https://repo1.maven.org/maven2/com/github/luben/zstd-jni/1.5.0-4/:maven
 PKGNAMESUFFIX=	4
 DISTNAME=	apache-${PORTNAME}-${DISTVERSION}-src
 DISTFILES=	${DISTNAME}.tar.gz:apache \
 		${ZSTD_DISTFILE} \
-		apache-${PORTNAME}-${DISTVERSION}-repo.tar.gz:repo
+		${MAVEN_CACHE_FILE}:prefetch
+DIST_SUBDIR=	${PORTNAME}
 EXTRACT_ONLY=	${DISTNAME}.tar.gz \
-		apache-${PORTNAME}-${DISTVERSION}-repo.tar.gz
+		${MAVEN_CACHE_FILE}
 
 MAINTAINER=	language.devel@gmail.com
 COMMENT=	Highly scalable distributed database
@@ -19,19 +19,21 @@ WWW=		https://cassandra.apache.org/
 LICENSE=	APACHE20
 LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 
+FETCH_DEPENDS=	ant:devel/apache-ant
 RUN_DEPENDS=	snappyjava>=0:archivers/snappy-java \
 		netty>0:java/netty
 
-USES=		cpe python:3.7+
+USES=		cpe python:3.7+ shebangfix
 USE_JAVA=	yes
 USE_ANT=	yes
 USE_RC_SUBR=	cassandra
+SHEBANG_FILES=	bin/cqlsh.py pylib/setup.py
 TEST_TARGET=	test
 CPE_VENDOR=	apache
 
 CONFLICTS=	cassandra3
 
-JAVA_VERSION=	8+
+JAVA_VERSION=	8 11
 JAVA_VENDOR=	openjdk
 
 SUB_LIST=	JAVA_HOME=${JAVA_HOME}
@@ -67,7 +69,7 @@ SCRIPT_FILES=	cassandra \
 		sstableutil \
 		sstableverify
 
-ZSTDJNI_VERSION=${MASTER_SITES:M*\:maven:H:T}
+ZSTDJNI_VERSION=	${MASTER_SITES:M*\:maven:H:T}
 PLIST_SUB=	DISTVERSION=${DISTVERSION} ZSTDJNI_VERSION=${ZSTDJNI_VERSION}
 
 OPTIONS_DEFINE=		SIGAR DOCS
@@ -82,14 +84,36 @@ DOCS_BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}sphinx>=0,1:textproc/py-sphinx@${PY_F
 
 PORTDOCS=		*
 
+MAVEN_CACHE_FILE=	apache-${PORTNAME}-${DISTVERSION}-repo.tar.xz
+
+.if !exists(${DISTDIR}/${DIST_SUBDIR}/${MAVEN_CACHE_FILE})
+pre-fetch:
+	${MKDIR} ${DISTDIR}/${DIST_SUBDIR}
+	${MKDIR} ${WRKSRC}/.build
+	${MKDIR} ${WRKSRC}/src/java
+	${CP} ${FILESDIR}/maven/build.* ${WRKSRC}
+	${CP} ${FILESDIR}/maven/build-* ${WRKSRC}/.build
+	cd ${WRKSRC} && ${ANT} -Dmaven.repo.local=${REPO_DIR} -Dlocal.repository=${REPO_DIR} ${USEJDK11} resolver-dist-lib
+	cd ${REPO_DIR} && ${FIND} . -type f -name "*.repositories" -a -exec ${SED} -i '' -e '2s,.*,Mon Aug 08 20:40:04 CEST 2022,' {} +
+	cd ${WRKDIR} && ${MTREE_CMD} -cbnSp repository | ${MTREE_CMD} -C | ${SED} \
+		-e 's:time=[0-9.]*:time=0.000000000:' \
+		-e 's:\([gu]id\)=[0-9]*:\1=0:g' \
+		-e 's:flags=.*:flags=none:' \
+		-e 's:^\.:./repository:' \
+		> maven-offline-cache.mtree
+	cd ${WRKDIR} && ${TAR} cJf ${DISTDIR}/${DIST_SUBDIR}/${MAVEN_CACHE_FILE} \
+		@maven-offline-cache.mtree
+	${SHA256} ${WRKDIR}/maven-offline-cache.mtree ${DISTDIR}/${DIST_SUBDIR}/${MAVEN_CACHE_FILE}
+.endif
+
 do-build:
 	@${DO_NADA} # Do nothing: Prevent USE_ANT from running a default build target.
 
 do-build-DOCS-on:
-	cd ${WRKSRC} && ${SETENV} CASSANDRA_LOG_DIR=${WRKDIR}/gen-doc-log ${ANT} -Dmaven.repo.local=${REPO_DIR} -Dlocalm2=${REPO_DIR} ${USEJDK11} -Dpycmd=${PYTHON_CMD} -Dpyver=${PYTHON_VER} freebsd-stage-doc
+	cd ${WRKSRC} && ${SETENV} CASSANDRA_LOG_DIR=${WRKDIR}/gen-doc-log ${ANT} -Dmaven.repo.local=${REPO_DIR} -Dlocal.repository=${REPO_DIR} ${USEJDK11} -Dpycmd=${PYTHON_CMD} -Dpyver=${PYTHON_VER} freebsd-stage-doc
 
 do-build-DOCS-off:
-	cd ${WRKSRC} && ${ANT} -Dmaven.repo.local=${REPO_DIR} -Dlocalm2=${REPO_DIR} ${USEJDK11} freebsd-stage
+	cd ${WRKSRC} && ${ANT} -Dmaven.repo.local=${REPO_DIR} -Dlocal.repository=${REPO_DIR} ${USEJDK11} freebsd-stage
 
 post-build:
 .for f in ${SCRIPT_FILES}
@@ -121,6 +145,8 @@ do-install:
 	cd ${BUILD_DIST_DIR} && ${INSTALL_DATA} bin/cassandra.in.sh ${STAGEDIR}${DATADIR}/bin/
 	cd ${BUILD_DIST_DIR} && ${COPYTREE_BIN} tools/bin ${STAGEDIR}${DATADIR}/
 	cd ${BUILD_DIST_DIR} && ${INSTALL_DATA} tools/bin/cassandra.in.sh ${STAGEDIR}${DATADIR}/tools/bin/
+	cd ${BUILD_DIST_DIR} && ${INSTALL_DATA} tools/lib/fqltool.jar ${STAGEDIR}${DATADIR}/tools/lib/
+	cd ${BUILD_DIST_DIR} && ${INSTALL_DATA} tools/lib/stress.jar ${STAGEDIR}${DATADIR}/tools/lib/
 .for f in ${SCRIPT_FILES}
 	${RLN} ${STAGEDIR}${DATADIR}/bin/${f} ${STAGEDIR}${PREFIX}/bin/${f}
 .endfor
@@ -128,12 +154,12 @@ do-install:
 	${LN} -s ${JAVAJARDIR}/snappy-java.jar ${STAGEDIR}${DATADIR}/lib/snappy-java.jar
 
 do-test:
-	@cd ${WRKSRC} && ${ANT} -Dmaven.repo.local=${REPO_DIR} -Dlocalm2=${REPO_DIR} ${USEJDK11} -Dstagedlib=${STAGEDIR}${DATADIR}/lib test
+	@cd ${WRKSRC} && ${ANT} -Dmaven.repo.local=${REPO_DIR} -Dlocal.repository=${REPO_DIR} ${USEJDK11} -Dstagedlib=${STAGEDIR}${DATADIR}/lib test
 
 .include <bsd.port.pre.mk>
 
 .if ${JAVA_PORT_VERSION} == 11
-USEJDK11=	-Duse.jdk11=true
+USEJDK11=	-Duse.jdk11=true -Drat.skip=true
 .endif
 
 .if ${ARCH} == amd64
@@ -156,7 +182,7 @@ ZSTD_DISTFILE=
 post-install:
 	${LN} -s ${JAVAJARDIR}/netty.jar ${STAGEDIR}${DATADIR}/lib/netty.jar
 .if ${ARCH} == amd64 || ${ARCH} == i386
-	${CP} ${DISTDIR}/zstd-jni-${ZSTDJNI_VERSION}-freebsd_${ARCH}.jar ${STAGEDIR}${DATADIR}/lib/
+	${CP} ${DISTDIR}/${DIST_SUBDIR}/zstd-jni-${ZSTDJNI_VERSION}-freebsd_${ARCH}.jar ${STAGEDIR}${DATADIR}/lib/
 .endif
 
 post-install-DOCS-on:
diff --git a/databases/cassandra4/distinfo b/databases/cassandra4/distinfo
index 82d3b4cbe97c..976d31650bd9 100644
--- a/databases/cassandra4/distinfo
+++ b/databases/cassandra4/distinfo
@@ -1,9 +1,9 @@
-TIMESTAMP = 1601573969
-SHA256 (apache-cassandra-4.0-beta2-src.tar.gz) = 02347ce3d55fd7d68f90c112ee01d82902dfd959cf03c107a51d15bcaabb48c5
-SIZE (apache-cassandra-4.0-beta2-src.tar.gz) = 46741277
-SHA256 (zstd-jni-1.4.5-4-freebsd_amd64.jar) = cdfcacd3d0b405869fc71c7c73ff861fa5421045f53a6168a0d0b4e8ae7ebfbc
-SIZE (zstd-jni-1.4.5-4-freebsd_amd64.jar) = 512671
-SHA256 (zstd-jni-1.4.5-4-freebsd_i386.jar) = bb3e6e4081ffbe28648983d3c2f47cd488a29b6bb09b1e9f1219cdf82b3ed648
-SIZE (zstd-jni-1.4.5-4-freebsd_i386.jar) = 418462
-SHA256 (apache-cassandra-4.0-beta2-repo.tar.gz) = 9a0d3ad05f535158dd65761a16f3a9fb0362cbe365d6e08ef6d9896bbf3a022f
-SIZE (apache-cassandra-4.0-beta2-repo.tar.gz) = 77730955
+TIMESTAMP = 1679924890
+SHA256 (cassandra/apache-cassandra-4.0.8-src.tar.gz) = 98da97d7fe850a0a24eb2aef212e982f73205cbd63955d2915b4ad02e28dae9c
+SIZE (cassandra/apache-cassandra-4.0.8-src.tar.gz) = 12953548
+SHA256 (cassandra/zstd-jni-1.5.0-4-freebsd_amd64.jar) = b653460b6ff374db2c01f39a7b7cdb44008c9efd55dc96ae5f869abe9f58d180
+SIZE (cassandra/zstd-jni-1.5.0-4-freebsd_amd64.jar) = 670993
+SHA256 (cassandra/zstd-jni-1.5.0-4-freebsd_i386.jar) = 1bcb75c5837e42d10ec0193ba9df099874792f0829b0ce8dd3412303c6454595
+SIZE (cassandra/zstd-jni-1.5.0-4-freebsd_i386.jar) = 604557
+SHA256 (cassandra/apache-cassandra-4.0.8-repo.tar.xz) = 807a108e3639f247dafa3ce4ebc4744b93668cf463915edf7b654d317d1abaff
+SIZE (cassandra/apache-cassandra-4.0.8-repo.tar.xz) = 78148020
diff --git a/databases/cassandra4/files/cassandra.in b/databases/cassandra4/files/cassandra.in
index 421ba7e55d9c..9615fbe572f6 100644
--- a/databases/cassandra4/files/cassandra.in
+++ b/databases/cassandra4/files/cassandra.in
@@ -23,13 +23,12 @@ load_rc_config $name
 : ${cassandra_enable:=NO}
 : ${cassandra_user:=cassandra}
 
-command=%%PREFIX%%/bin/cassandra
-command_args="-p /var/run/cassandra/cassandra.pid >/dev/null 2>/dev/null"
-start_precmd="${name}_prestart"
-
-procname=%%JAVA_HOME%%/bin/java
 pidfile=/var/run/cassandra/cassandra.pid
 
+command=/usr/sbin/daemon
+command_args="-frP ${pidfile} %%PREFIX%%/bin/cassandra -f"
+start_precmd="${name}_prestart"
+
 cassandra_prestart()
 {
 	export JAVA_HOME=%%JAVA_HOME%%
diff --git a/databases/cassandra4/files/maven/build-owasp.xml b/databases/cassandra4/files/maven/build-owasp.xml
new file mode 100644
index 000000000000..f3174999e8d4
--- /dev/null
+++ b/databases/cassandra4/files/maven/build-owasp.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+  ~ 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.
+  -->
+<project basedir="." name="apache-cassandra-owasp-tasks">
+    <property name="dependency-check.version" value="6.3.2"/>
+    <property name="dependency-check.home" value="${build.dir}/dependency-check-ant-${dependency-check.version}"/>
+
+    <condition property="is.dependency.check.jar">
+        <available file="${dependency-check.home}/dependency-check-ant/dependency-check-ant.jar" type="file" />
+    </condition>
+
+    <target name="dependency-check-download"
+            depends="build"
+            description="Fetch OWASP Dependency checker"
+            unless="is.dependency.check.jar">
+
+        <echo>Downloading OWASP Dependency checks ...</echo>
+
+        <mkdir dir="${dependency-check.home}"/>
+
+        <get src="https://github.com/jeremylong/DependencyCheck/releases/download/v${dependency-check.version}/dependency-check-ant-${dependency-check.version}-release.zip"
+             dest="${dependency-check.home}/dependency-check-ant-${dependency-check.version}-release.zip"/>
+
+        <unzip src="${dependency-check.home}/dependency-check-ant-${dependency-check.version}-release.zip" dest="${dependency-check.home}"/>
+    </target>
+
+    <target name="dependency-check" description="Dependency-Check Analysis" depends="dependency-check-download,resolver-dist-lib">
+
+        <path id="dependency-check.path">
+            <fileset dir="${dependency-check.home}/dependency-check-ant/lib">
+                <include name="*.jar"/>
+            </fileset>
+        </path>
+
+        <taskdef resource="dependency-check-taskdefs.properties">
+            <classpath refid="dependency-check.path" />
+        </taskdef>
+
+        <!--
+            default value for cveValidForHours is 4 after which sync is done again
+
+            skipping using two specific caches at the end is solving (1)
+
+            failBuildOnCVSS is by default 11 so build would never fail,
+            the table categorising vulnerabilities is here (2), so by setting
+            "failBuildOnCVSS" to 1, we will fail the build on any CVE found
+            if it is not suppressed already dependency-check-suppressions.xml
+
+            If a vendor provides no details about a vulnerability,
+            NVD will score that vulnerability as 10.0 (the highest rating translating to critical).
+
+            (1) https://github.com/jeremylong/DependencyCheck/issues/2166
+            (2) https://nvd.nist.gov/vuln-metrics/cvss
+        -->
+        <dependency-check projectname="Apache Cassandra"
+                          reportoutputdirectory="${basedir}/build"
+                          reportformat="HTML"
+                          prettyPrint="true"
+                          cveValidForHours="1"
+                          centralAnalyzerUseCache="false"
+                          nodeAuditAnalyzerUseCache="false"
+                          failBuildOnCVSS="1"
+                          assemblyAnalyzerEnabled="false"
+                          dataDirectory="${dependency-check.home}/data"
+                          suppressionFile="${basedir}/.build/dependency-check-suppressions.xml">
+            <fileset dir="lib">
+                <include name="**/*.jar"/>
+            </fileset>
+        </dependency-check>
+    </target>
+</project>
diff --git a/databases/cassandra4/files/maven/build-rat.xml b/databases/cassandra4/files/maven/build-rat.xml
new file mode 100644
index 000000000000..5a6aa0aa8546
--- /dev/null
+++ b/databases/cassandra4/files/maven/build-rat.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+  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.
+-->
+<project basedir="." name="apache-cassandra--rat-tasks"
+     xmlns:rat="antlib:org.apache.rat.anttasks">
+
+    <!--
+      License audit tool
+    -->
+
+    <target name="_rat_init" depends="resolver-init">
+        <typedef uri="antlib:org.apache.rat.anttasks" classpathref="rat.classpath"/>
+    </target>
+
+    <target name="_build_ratinclude" depends="_rat_init">
+        <exec executable="git" failifexecutionfails="false" failonerror="false" resultproperty="git.success" output="build/.versioned_files">
+            <arg line="ls-tree -r HEAD --name-only"/>
+        </exec>
+        <condition property="rat.skip" value="true">
+            <not>
+                <equals arg1="${git.success}" arg2="0"/>
+            </not>
+        </condition>
+        <copy file="build/.versioned_files" tofile="build/.ratinclude">
+            <filterchain>
+                <linecontainsregexp>
+                    <regexp pattern=".*\.(java|py|sh|xml|spec|md|iml|bat|btm|cql|css|g|html|jflex|jks|mod|name|pom|textile|yml|yaml|MIDRES|HIGHRES|LOWRES)$"/>
+                </linecontainsregexp>
+            </filterchain>
+        </copy>
+    </target>
+
+    <target name="rat-check" depends="_build_ratinclude" unless="${rat.skip}" description="License checks on source" >
+        <rat:report reportFile="${build.dir}/rat.txt">
+            <fileset dir="." includesfile="build/.ratinclude">
+                 <!-- Config files with not much creativity -->
+                 <exclude name="**/ide/**/*"/>
+                 <exclude name="**/metrics-reporter-config-sample.yaml"/>
+                 <exclude name="**/cassandra.yaml"/>
+                 <exclude name="**/cassandra-murmur.yaml"/>
+                 <exclude name="**/cassandra-seeds.yaml"/>
+                 <exclude NAME="**/doc/antora.yml"/>
+                 <exclude name="**/test/conf/cassandra.yaml"/>
+                 <exclude name="**/test/conf/cassandra_deprecated_parameters_names.yaml"/>
+                 <exclude name="**/test/conf/cassandra_encryption.yaml"/>
+                 <exclude name="**/test/conf/cdc.yaml"/>
+                 <exclude name="**/test/conf/commitlog_compression_LZ4.yaml"/>
+                 <exclude name="**/test/conf/commitlog_compression_Zstd.yaml"/>
+                 <exclude name="**/test/conf/system_keyspaces_directory.yaml"/>
+                 <exclude name="**/test/conf/sstableloader_with_encryption.yaml"/>
+                 <exclude name="**/test/conf/unit-test-conf/test-native-port.yaml"/>
+                 <exclude name="**/test/data/jmxdump/cassandra-3.0-jmx.yaml"/>
+                 <exclude name="**/test/data/jmxdump/cassandra-3.11-jmx.yaml"/>
+                 <exclude name="**/test/data/jmxdump/cassandra-4.0-jmx.yaml"/>
+                 <exclude name="**/tools/cqlstress-counter-example.yaml"/>
+                 <exclude name="**/tools/cqlstress-example.yaml"/>
+                 <exclude name="**/tools/cqlstress-insanity-example.yaml"/>
+                 <exclude name="**/tools/cqlstress-lwt-example.yaml"/>
+                 <!-- Documentation files -->
+                 <exclude NAME="**/doc/modules/**/*"/>
+                 <!-- NOTICE files -->
+                 <exclude NAME="**/NOTICE.md"/>
+                 <!-- LICENSE files -->
+                 <exclude NAME="**/LICENSE.md"/>
+            </fileset>
+        </rat:report>
+        <exec executable="grep" outputproperty="rat.failed.files" failifexecutionfails="false">
+            <arg line="-A5 'Unapproved licenses' ${build.dir}/rat.txt"/>
+        </exec>
+        <fail message="Some files have missing or incorrect license information. Check RAT report in ${build.dir}/rat.txt for more details! \n ${rat.failed.files}">
+            <condition>
+                <and>
+                    <not>
+                        <resourcecontains resource="${build.dir}/rat.txt" substring="0 Unknown Licenses" casesensitive="false" />
+                    </not>
+                </and>
+            </condition>
+        </fail>
+    </target>
+
+    <target name="_assert_rat_output">
+        <fail message="The rat report at build/rat.txt was not generated. Please ensure that the rat-check task is able to run successfully. For dev builds only, touch build/rat.txt to skip this check">
+            <condition>
+                <not>
+                    <available file="build/rat.txt" />
+                </not>
+            </condition>
+        </fail>
+    </target>
+
+</project>
diff --git a/databases/cassandra4/files/maven/build-resolver.xml b/databases/cassandra4/files/maven/build-resolver.xml
new file mode 100644
index 000000000000..a159d97acaff
--- /dev/null
+++ b/databases/cassandra4/files/maven/build-resolver.xml
@@ -0,0 +1,262 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+  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.
+-->
+<project basedir="." name="apache-cassandra--resolver-tasks"
+         xmlns:resolver="antlib:org.apache.maven.resolver.ant"
+         xmlns:if="ant:if"
+         xmlns:unless="ant:unless">
+
+    <!-- details of what version of Resolver ANT Tasks to fetch -->
+    <property name="resolver-ant-tasks.version" value="1.3.0" />
+    <property name="resolver-ant-tasks.local" value="${local.repository}/org/apache/maven/resolver/maven-resolver-ant-tasks/${resolver-ant-tasks.version}/maven-resolver-ant-tasks-${resolver-ant-tasks.version}.jar"/>
+    <property name="resolver-ant-tasks.url" value="https://repo1.maven.org/maven2/org/apache/maven/resolver/maven-resolver-ant-tasks" />
+    <condition property="resolver-ant-tasks.jar.exists">
+        <available file="${resolver-ant-tasks.local}" />
+    </condition>
+
+    <property name="artifact.python.pypi" value="https://files.pythonhosted.org/packages" />
+    <property name="artifact.github.release" value="https://github.com" />
+
+    <!-- some artifacts are fetched from github as blobs; these are all in the cassandra project, but in an older commit -->
+    <property name="lib.download.sha" value="1371883db3d8bf7d7c54e0baaca89c6c2d2a5abe"/>
+    <property name="lib.download.base.url" value="https://raw.githubusercontent.com/apache/cassandra/${lib.download.sha}" />
+    <property name="lib.download.url.postfix" value="" />
+
+    <path id="resolver-ant-tasks.classpath" path="${resolver-ant-tasks.local}" />
+
+    <!--
+       Fetch Resolver Ant Tasks and Cassandra's dependencies.
+    -->
+
+    <target name="_resolver_download" unless="resolver-ant-tasks.jar.exists" description="Fetch Resolver ANT Tasks from Maven Central Repository">
+        <echo>Downloading Resolver ANT Tasks...</echo>
+        <mkdir dir="${local.repository}/org/apache/maven/resolver/maven-resolver-ant-tasks/${resolver-ant-tasks.version}" />
+
+        <get src="${resolver-ant-tasks.url}/${resolver-ant-tasks.version}/maven-resolver-ant-tasks-${resolver-ant-tasks.version}-uber.jar"
+             dest="${resolver-ant-tasks.local}" usetimestamp="true" quiet="true"/>
+    </target>
+
+    <target name="resolver-init" depends="init,_resolver_download" unless="resolver-ant-tasks.initialized" description="Initialize Resolver ANT Tasks">
+
+        <typedef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml" classpathref="resolver-ant-tasks.classpath" />
+        <resolver:remoterepos id="all">
+            <remoterepo id="resolver-central" url="${artifact.remoteRepository.central}"/>
+            <remoterepo id="resolver-apache" url="${artifact.remoteRepository.apache}"/>
+        </resolver:remoterepos>
+
+        <macrodef name="resolve">
+            <!--
+              maven-resolver-ant-tasks's resolve logic doesn't have retry logic and does not respect settings.xml,
+              this causes issues when overriding maven central is required (such as when behind a corporate firewall);
+              it is critical to always provide the 'all' remoterepos to override resolve's default hard coded logic.
+
+              This macro simplifies this logic by centralizing retries and forcing the remoterepo 'all' to be used.
+            -->
+            <attribute name="failonmissingattachments" default="true"/>
+            <element name="elements" implicit="yes"/>
+            <sequential>
+                <retry retrycount="3">
+                  <resolver:resolve failonmissingattachments="@{failonmissingattachments}">
+                        <resolver:remoterepos refid="all"/>
+                        <elements/>
+                    </resolver:resolve>
+                </retry>
+            </sequential>
+        </macrodef>
+        <macrodef name="resolvepom">
+            <attribute name="file"/>
+            <attribute name="id"/>
+            <element name="elements" implicit="yes" optional="yes"/>
+            <sequential>
+                <retry retrycount="3">
+                    <resolver:pom file="@{file}" id="@{id}">
+                          <remoterepos refid="all"/>
+                          <elements/>
+                    </resolver:pom>
+                </retry>
+            </sequential>
+        </macrodef>
+
+        <resolve>
+            <dependencies>
+                <dependency groupId="com.datastax.wikitext" artifactId="wikitext-core-ant" version="1.3"/>
+                <dependency groupId="org.fusesource.wikitext" artifactId="textile-core" version="1.3"/>
+            </dependencies>
+            <path refid="wikitext.classpath" classpath="runtime"/>
+        </resolve>
+        <resolve>
+            <dependencies>
+                <dependency groupId="org.apache.rat" artifactId="apache-rat-tasks" version="0.6" />
+            </dependencies>
+            <path refid="rat.classpath" classpath="runtime"/>
+        </resolve>
+        <resolve>
+            <dependencies>
+                <dependency groupId="org.jacoco" artifactId="org.jacoco.ant" version="${jacoco.version}" />
+            </dependencies>
+            <path refid="jacocoant.classpath" classpath="runtime"/>
+        </resolve>
+        <resolve>
+            <dependencies>
+                <dependency groupId="org.antlr" artifactId="antlr" version="3.5.2"/>
+                <dependency groupId="org.antlr" artifactId="antlr-runtime" version="3.5.2"/>
+                <dependency groupId="org.antlr" artifactId="ST4" version="4.0.8"/>
+            </dependencies>
+            <path refid="cql3-grammar.classpath" classpath="runtime"/>
+        </resolve>
+        <resolve>
+            <dependencies>
+                <dependency groupId="de.jflex" artifactId="jflex" version="${jflex.version}" />
+            </dependencies>
+            <path refid="jflex.classpath" classpath="runtime"/>
+        </resolve>
+
+        <macrodef name="install">
+            <attribute name="pomFile"/>
+            <attribute name="file"/>
+            <attribute name="classifier" default=""/>
+            <attribute name="packaging" default="jar"/>
+            <sequential>
+                <exec dir="." executable="sh">
+                    <arg line="-c 'mvn org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file -DpomFile=@{pomFile} -Dfile=@{file} -Dclassifier=@{classifier} -Dpackaging=@{packaging}'" />
+                </exec>
+            </sequential>
+        </macrodef>
+
+        <macrodef name="deploy">
+            <attribute name="pomFile"/>
+            <attribute name="file"/>
+            <attribute name="classifier" default=""/>
+            <attribute name="packaging" default="jar"/>
+            <sequential>
+                <exec dir="." executable="sh">
+                    <arg line="-c 'mvn org.apache.maven.plugins:maven-gpg-plugin:1.6:sign-and-deploy-file -DretryFailedDeploymentCount=5 -Durl=${maven-repository-url} -DrepositoryId=${maven-repository-id} -DpomFile=@{pomFile} -Dfile=@{file} -Dclassifier=@{classifier} -Dpackaging=@{packaging}'" />
+                </exec>
+            </sequential>
+        </macrodef>
+
+        <macrodef name="sign-dist">
+            <attribute name="file"/>
+            <sequential>
+                <echo message="gpg signing @{file}" />
+                <exec dir="." executable="sh">
+                    <!-- dummy out the deploy parameters, only the signing is required here -->
+                    <arg line="-c 'mvn -q org.apache.maven.plugins:maven-gpg-plugin:1.6:sign-and-deploy-file -Dfile=@{file} -DgroupId=org.apache.cassandra -DartifactId=cassandra-parent -Dversion=${version} -Durl=file:///tmp/ -DrepositoryId=tmp'" />
+                </exec>
+            </sequential>
+        </macrodef>
+
+        <property name="resolver-ant-tasks.initialized" value="true"/>
+    </target>
+
+    <target name="resolver-retrieve-build" depends="resolver-init,write-poms">
+        <resolvepom file="${build.dir}/${final.name}.pom" id="all-pom" />
+        <resolvepom file="${build.dir}/tmp-${final.name}-deps.pom" id="pom-deps" />
+
+        <resolve>
+            <dependencies pomRef="all-pom"/>
+            <files dir="${build.dir.lib}/jars" layout="{artifactId}-{version}-{classifier}.{extension}" scopes="compile,provided,!system"/>
+        </resolve>
+        <resolve>
+            <dependencies pomRef="pom-deps"/>
+            <files dir="${test.lib}/jars" layout="{artifactId}-{version}-{classifier}.{extension}" scopes="test,!provide,!system"/>
+        </resolve>
+
+
+        <!-- jacoco agent jar comes wrapped in a jar -->
+        <unzip src="${local.repository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}.jar" dest="${build.dir.lib}/jars">
+            <patternset>
+                <include name="*.jar"/>
+            </patternset>
+            <mapper type="flatten"/>
+        </unzip>
+    </target>
+
+    <target name="resolver-dist-lib" depends="resolver-retrieve-build,write-poms">
+        <resolvepom file="${build.dir}/${final.name}.pom" id="all-pom" />
+
+        <resolve failOnMissingAttachments="true">
+            <dependencies pomRef="all-pom"/>
+            <files dir="${build.lib}" layout="{artifactId}-{version}-{classifier}.{extension}" scopes="compile,!provide,!system"/>
+        </resolve>
+        <mkdir dir="${local.repository}/org/apache/cassandra/deps/sigar-bin"/>
+        <mkdir dir="${build.lib}/sigar-bin"/>
+
+        <!-- files.pythonhosted.org -->
+        <get src="${artifact.python.pypi}/59/a0/cf4cd997e1750f0c2d91c6ea5abea218251c43c3581bcc2f118b00baf5cf/futures-2.1.6-py2.py3-none-any.whl" dest="${local.repository}/org/apache/cassandra/deps/futures-2.1.6-py2.py3-none-any.zip" usetimestamp="true" quiet="true" skipexisting="true"/>
+        <get src="${artifact.python.pypi}/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl" dest="${local.repository}/org/apache/cassandra/deps/six-1.12.0-py2.py3-none-any.zip" usetimestamp="true" quiet="true" skipexisting="true"/>
+
+        <!-- apache/cassandra/lib -->
+        <get src="${lib.download.base.url}/lib/geomet-0.1.0.zip" dest="${local.repository}/org/apache/cassandra/deps/geomet-0.1.0.zip" usetimestamp="true" quiet="true" skipexisting="true"/>
+        <get dest="${local.repository}/org/apache/cassandra/deps/sigar-bin/" quiet="true" usetimestamp="true" skipexisting="true">
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-amd64-freebsd-6.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-amd64-linux.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-amd64-solaris.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-ia64-hpux-11.sl"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-ia64-linux.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-pa-hpux-11.sl"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-ppc-aix-5.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-ppc-linux.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-ppc64-aix-5.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-ppc64-linux.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-ppc64le-linux.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-s390x-linux.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-sparc-solaris.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-sparc64-solaris.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-universal-macosx.dylib"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-universal64-macosx.dylib"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-x86-freebsd-5.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-x86-freebsd-6.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-x86-linux.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/libsigar-x86-solaris.so"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/sigar-amd64-winnt.dll"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/sigar-x86-winnt.dll"/>
+            <url url="${lib.download.base.url}/lib/sigar-bin/sigar-x86-winnt.lib"/>
+        </get>
+
+        <copy todir="${build.lib}" quiet="true">
+            <file file="${local.repository}/org/apache/cassandra/deps/futures-2.1.6-py2.py3-none-any.zip"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/six-1.12.0-py2.py3-none-any.zip"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/geomet-0.1.0.zip"/>
+        </copy>
+        <copy todir="${build.lib}/sigar-bin/" quiet="true">
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-amd64-freebsd-6.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-amd64-linux.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-amd64-solaris.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-ia64-hpux-11.sl"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-ia64-linux.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-pa-hpux-11.sl"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-ppc-aix-5.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-ppc-linux.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-ppc64-aix-5.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-ppc64-linux.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-ppc64le-linux.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-s390x-linux.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-sparc-solaris.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-sparc64-solaris.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-universal-macosx.dylib"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-universal64-macosx.dylib"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-x86-freebsd-5.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-x86-freebsd-6.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-x86-linux.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-x86-solaris.so"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/sigar-amd64-winnt.dll"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/sigar-x86-winnt.dll"/>
+            <file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/sigar-x86-winnt.lib"/>
+        </copy>
+    </target>
+</project>
diff --git a/databases/cassandra4/files/maven/build.properties.default b/databases/cassandra4/files/maven/build.properties.default
new file mode 100644
index 000000000000..11da534e32c1
--- /dev/null
+++ b/databases/cassandra4/files/maven/build.properties.default
@@ -0,0 +1,4 @@
+# Maven2 Repository Locations (you can override these in "build.properties" to point to a local proxy, e.g. Nexus)
+artifact.remoteRepository.central:     https://repo1.maven.org/maven2
+artifact.remoteRepository.apache:      https://repo.maven.apache.org/maven2
+
diff --git a/databases/cassandra4/files/maven/build.xml b/databases/cassandra4/files/maven/build.xml
new file mode 100644
index 000000000000..e9093d367d3b
--- /dev/null
+++ b/databases/cassandra4/files/maven/build.xml
@@ -0,0 +1,2174 @@
+<!--
+  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.
+-->
+<project basedir="." default="jar" name="apache-cassandra"
+         xmlns:artifact="antlib:org.apache.maven.artifact.ant"
+         xmlns:if="ant:if"
+         xmlns:unless="ant:unless">
+
+    <fail message="You need to use Ant of version at least 1.10 to continue.">
+      <condition>
+        <not>
+          <antversion atleast="1.10"/>
+        </not>
+      </condition>
+    </fail>
+
+    <property environment="env"/>
+    <property file="build.properties" />
+    <property file="build.properties.default" />
+    <property name="debuglevel" value="source,lines,vars"/>
+
+    <!-- default version and SCM information -->
+    <property name="base.version" value="4.0.5"/>
+    <property name="scm.connection" value="scm:https://gitbox.apache.org/repos/asf/cassandra.git"/>;
+    <property name="scm.developerConnection" value="scm:https://gitbox.apache.org/repos/asf/cassandra.git"/>;
+    <property name="scm.url" value="https://gitbox.apache.org/repos/asf?p=cassandra.git;a=tree"/>;
+
+    <!-- directory details -->
+    <property name="basedir" value="."/>
+    <property name="build.src" value="${basedir}/src"/>
+    <property name="build.src.java" value="${basedir}/src/java"/>
+    <property name="build.src.antlr" value="${basedir}/src/antlr"/>
+    <property name="build.src.resources" value="${basedir}/src/resources"/>
+    <property name="build.src.gen-java" value="${basedir}/src/gen-java"/>
+    <property name="build.lib" value="${basedir}/lib"/>
+    <property name="build.dir" value="${basedir}/build"/>
+    <property name="build.dir.lib" value="${basedir}/build/lib"/>
+    <property name="build.test.dir" value="${build.dir}/test"/>
+    <property name="build.classes" value="${build.dir}/classes"/>
+    <property name="build.classes.main" value="${build.classes}/main" />
+    <property name="javadoc.dir" value="${build.dir}/javadoc"/>
+    <property name="interface.dir" value="${basedir}/interface"/>
+    <property name="test.dir" value="${basedir}/test"/>
+    <property name="test.resources" value="${test.dir}/resources"/>
+    <property name="test.lib" value="${build.dir}/test/lib"/>
+    <property name="test.classes" value="${build.dir}/test/classes"/>
+    <property name="test.conf" value="${test.dir}/conf"/>
+    <property name="test.data" value="${test.dir}/data"/>
+    <property name="test.name" value="*Test"/>
+    <property name="test.classlistfile" value="testlist.txt"/>
+    <property name="test.classlistprefix" value="unit"/>
+    <property name="benchmark.name" value=""/>
+    <property name="test.methods" value=""/>
+    <property name="test.unit.src" value="${test.dir}/unit"/>
+    <property name="test.long.src" value="${test.dir}/long"/>
+    <property name="test.burn.src" value="${test.dir}/burn"/>
+    <property name="test.memory.src" value="${test.dir}/memory"/>
+    <property name="test.microbench.src" value="${test.dir}/microbench"/>
+    <property name="test.distributed.src" value="${test.dir}/distributed"/>
+    <property name="test.compression.algo" value="LZ4"/>
+    <property name="test.driver.connection_timeout_ms" value="5000"/>
+    <property name="test.driver.read_timeout_ms" value="12000"/>
+    <property name="dist.dir" value="${build.dir}/dist"/>
+    <property name="tmp.dir" value="${java.io.tmpdir}"/>
+
+    <property name="doc.dir" value="${basedir}/doc"/>
+
+    <condition property="version" value="${base.version}">
+      <isset property="release"/>
+    </condition>
+    <property name="version" value="${base.version}-SNAPSHOT"/>
+    <property name="version.properties.dir"
+              value="${build.src.resources}/org/apache/cassandra/config/" />
+    <property name="final.name" value="${ant.project.name}-${version}"/>
+
+    <property name="local.repository" value="${user.home}/.m2/repository" />
+
+    <!-- details of what version of Maven ANT Tasks to fetch -->
+    <property name="maven-ant-tasks.version" value="2.1.3" />
+    <property name="maven-ant-tasks.local" value="${local.repository}/org/apache/maven/maven-ant-tasks"/>
+    <property name="maven-ant-tasks.url"
+              value="https://repo.maven.apache.org/maven2/org/apache/maven/maven-ant-tasks" />
+    <!-- details of how and which Maven repository we publish to -->
+    <property name="maven.version" value="3.0.3" />
+    <condition property="maven-repository-url" value="https://repository.apache.org/service/local/staging/deploy/maven2">;
+      <isset property="release"/>
+    </condition>
+    <condition property="maven-repository-id" value="apache.releases.https">
+      <isset property="release"/>
+    </condition>
+    <property name="maven-repository-url" value="https://repository.apache.org/content/repositories/snapshots"/>;
+    <property name="maven-repository-id" value="apache.snapshots.https"/>
+
+    <property name="test.timeout" value="240000" />
+    <property name="test.memory.timeout" value="480000" />
+    <property name="test.long.timeout" value="600000" />
+    <property name="test.burn.timeout" value="60000000" />
+    <property name="test.distributed.timeout" value="900000" />
+
+    <!-- default for cql tests. Can be override by -Dcassandra.test.use_prepared=false -->
+    <property name="cassandra.test.use_prepared" value="true" />
+
+    <!-- skip flushing schema tables during tests -->
+    <property name="cassandra.test.flush_local_schema_changes" value="false" />
+
+    <!-- https://www.eclemma.org/jacoco/ -->
+    <property name="jacoco.export.dir" value="${build.dir}/jacoco/" />
+    <property name="jacoco.partials.dir" value="${jacoco.export.dir}/partials" />
+    <property name="jacoco.partialexecfile" value="${jacoco.partials.dir}/partial.exec" />
+    <property name="jacoco.finalexecfile" value="${jacoco.export.dir}/jacoco.exec" />
+    <property name="jacoco.version" value="0.8.6"/>
+
+    <property name="byteman.version" value="4.0.6"/>
+    <property name="jamm.version" value="0.3.2"/>
+    <property name="ecj.version" value="4.6.1"/>
+    <property name="ohc.version" value="0.5.1"/>
+    <property name="asm.version" value="7.1"/>
+    <property name="allocation-instrumenter.version" value="3.1.0"/>
+    <property name="bytebuddy.version" value="1.10.10"/>
+    <property name="jflex.version" value="1.8.2"/>
+
+    <!-- https://mvnrepository.com/artifact/net.openhft/chronicle-bom/1.16.23 -->
+    <property name="chronicle-queue.version" value="5.20.123" />
+    <property name="chronicle-core.version" value="2.20.126" />
+    <property name="chronicle-bytes.version" value="2.20.111" />
+    <property name="chronicle-wire.version" value="2.20.117" />
+    <property name="chronicle-threads.version" value="2.20.111" />
+
+    <condition property="maven-ant-tasks.jar.exists">
+      <available file="${build.dir}/maven-ant-tasks-${maven-ant-tasks.version}.jar" />
+    </condition>
+
+    <condition property="maven-ant-tasks.jar.local">
+      <available file="${maven-ant-tasks.local}/${maven-ant-tasks.version}/maven-ant-tasks-${maven-ant-tasks.version}.jar" />
+    </condition>
+
+    <condition property="is.source.artifact">
+      <available file="${build.src.java}" type="dir" />
+    </condition>
+
+    <!-- Check if all tests are being run or just one. If it's all tests don't spam the console with test output.
+         If it's an individual test print the output from the test under the assumption someone is debugging the test
+         and wants to know what is going on without having to context switch to the log file that is generated.
+         Debug level output still needs to be retrieved from the log file.  -->
+    <script language="javascript">
+        if (project.getProperty("cassandra.keepBriefBrief") == null)
+        {
+            if (project.getProperty("test.name").equals("*Test"))
+                project.setProperty("cassandra.keepBriefBrief", "true");
+            else
+                project.setProperty("cassandra.keepBriefBrief", "false");
+        }
+    </script>
+
+    <condition property="java.version.8">
+        <equals arg1="${ant.java.version}" arg2="1.8"/>
+    </condition>
+    <condition property="java.version.11">
+        <not><isset property="java.version.8"/></not>
+    </condition>
+    <fail><condition><not><or>
+        <isset property="java.version.8"/>
+        <isset property="java.version.11"/>
+    </or></not></condition></fail>
+
+    <resources id="_jvm11_arg_items">
+        <string>-Djdk.attach.allowAttachSelf=true</string>
+
+        <string>-XX:+UseConcMarkSweepGC</string>
+        <string>-XX:+CMSParallelRemarkEnabled</string>
+        <string>-XX:SurvivorRatio=8</string>
+        <string>-XX:MaxTenuringThreshold=1</string>
+        <string>-XX:CMSInitiatingOccupancyFraction=75</string>
+        <string>-XX:+UseCMSInitiatingOccupancyOnly</string>
+        <string>-XX:CMSWaitDuration=10000</string>
+        <string>-XX:+CMSParallelInitialMarkEnabled</string>
+        <string>-XX:+CMSEdenChunksRecordAlways</string>
+
+        <string>--add-exports java.base/jdk.internal.misc=ALL-UNNAMED</string>
+        <string>--add-exports java.base/jdk.internal.ref=ALL-UNNAMED</string>
+        <string>--add-exports java.base/sun.nio.ch=ALL-UNNAMED</string>
+        <string>--add-exports java.management.rmi/com.sun.jmx.remote.internal.rmi=ALL-UNNAMED</string>
+        <string>--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED</string>
+        <string>--add-exports java.rmi/sun.rmi.server=ALL-UNNAMED</string>
+        <string>--add-exports java.sql/java.sql=ALL-UNNAMED</string>
+
+        <string>--add-opens java.base/java.lang.module=ALL-UNNAMED</string>
+        <string>--add-opens java.base/java.net=ALL-UNNAMED</string>
+        <string>--add-opens java.base/jdk.internal.loader=ALL-UNNAMED</string>
+        <string>--add-opens java.base/jdk.internal.ref=ALL-UNNAMED</string>
+        <string>--add-opens java.base/jdk.internal.reflect=ALL-UNNAMED</string>
+        <string>--add-opens java.base/jdk.internal.math=ALL-UNNAMED</string>
+        <string>--add-opens java.base/jdk.internal.module=ALL-UNNAMED</string>
+        <string>--add-opens java.base/jdk.internal.util.jar=ALL-UNNAMED</string>
+        <string>--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED</string>
+    </resources>
+    <pathconvert property="_jvm_args_concat" refid="_jvm11_arg_items" pathsep=" "/>
+    <condition property="java11-jvmargs" value="${_jvm_args_concat}" else="">
+        <not>
+            <equals arg1="${ant.java.version}" arg2="1.8"/>
+        </not>
+    </condition>
+
+    <!--
+      JVM arguments for tests.
+
+      There is a race condition bug in java 11 (see CASSANDRA-15981) which causes a crash of the
+      JVM; this race is between CMS and class unloading.  In java 8 we can cap the metaspace to
+      make tests stable on low resource environments, but in java 11 we need to make it unlimited
+      (don't define MaxMetaspaceSize) and disable class unloading in CMS outside of a
+      stop-the-world pause.
+
+      In java 11 we also need to set a system property to enable netty to use Unsafe direct byte
+      buffer construction (see CASSANDRA-16493)
+    -->
+    <resources id="_jvm8_test_arg_items">
+      <!-- TODO see CASSANDRA-16212 - we seem to OOM non stop now after CASSANDRA-16212, so to have clean CI while this gets looked into, disabling limiting metaspace
+        <string>-XX:MaxMetaspaceExpansion=64M</string>
+        <string>-XX:MaxMetaspaceSize=512M</string>
+        <string>-XX:MetaspaceSize=128M</string>
+      -->
+    </resources>
+    <pathconvert property="_jvm8_test_arg_items_concat" refid="_jvm8_test_arg_items" pathsep=" "/>
+    <resources id="_jvm11_test_arg_items">
+        <string>-XX:-CMSClassUnloadingEnabled</string>
+        <string>-Dio.netty.tryReflectionSetAccessible=true</string>
+    </resources>
+    <pathconvert property="_jvm11_test_arg_items_concat" refid="_jvm11_test_arg_items" pathsep=" "/>
+    <condition property="test-jvmargs" value="${_jvm11_test_arg_items_concat}" else="${_jvm8_test_arg_items_concat}">
+        <not>
+            <equals arg1="${ant.java.version}" arg2="1.8"/>
+        </not>
+    </condition>
+
+    <!-- needed to compile org.apache.cassandra.utils.JMXServerUtils -->
+    <condition property="jdk11-javac-exports" value="--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED" else="">
+        <not>
+            <equals arg1="${ant.java.version}" arg2="1.8"/>
+        </not>
+    </condition>
+    <condition property="jdk11-javadoc-exports" value="${jdk11-javac-exports} --frames" else="">
+        <not>
+            <equals arg1="${ant.java.version}" arg2="1.8"/>
+        </not>
+    </condition>
+
+    <condition property="build.java.11">
+        <istrue value="${use.jdk11}"/>
+    </condition>
+
+    <condition property="source.version" value="8" else="11">
+        <equals arg1="${java.version.8}" arg2="true"/>
+    </condition>
+    <condition property="target.version" value="8" else="11">
+        <equals arg1="${java.version.8}" arg2="true"/>
+    </condition>
+
+    <!--
+         Add all the dependencies.
+    -->
+    <path id="maven-ant-tasks.classpath" path="${build.dir}/maven-ant-tasks-${maven-ant-tasks.version}.jar" />
+    <path id="cassandra.classpath">
+        <pathelement location="${build.classes.main}" />
+        <fileset dir="${build.dir.lib}">
+            <include name="**/*.jar" />
+        </fileset>
+    </path>
+    <path id="cassandra.classpath.test">
+        <file file="${build.dir}/${final.name}.jar"/> <!-- we need the jar for tests and benchmarks (multi-version jar) -->
*** 2634 LINES SKIPPED ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202305152125.34FLPn6Z033393>