Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/databases/cassandra4/files/maven/build.xml
16465 views
1
<!--
2
Licensed to the Apache Software Foundation (ASF) under one or more
3
contributor license agreements. See the NOTICE file distributed with
4
this work for additional information regarding copyright ownership.
5
The ASF licenses this file to You under the Apache License, Version 2.0
6
(the "License"); you may not use this file except in compliance with
7
the License. You may obtain a copy of the License at
8
9
http://www.apache.org/licenses/LICENSE-2.0
10
11
Unless required by applicable law or agreed to in writing, software
12
distributed under the License is distributed on an "AS IS" BASIS,
13
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
See the License for the specific language governing permissions and
15
limitations under the License.
16
-->
17
<project basedir="." default="jar" name="apache-cassandra"
18
xmlns:artifact="antlib:org.apache.maven.artifact.ant"
19
xmlns:if="ant:if"
20
xmlns:unless="ant:unless">
21
22
<fail message="You need to use Ant of version at least 1.10 to continue.">
23
<condition>
24
<not>
25
<antversion atleast="1.10"/>
26
</not>
27
</condition>
28
</fail>
29
30
<property environment="env"/>
31
<property file="build.properties" />
32
<property file="build.properties.default" />
33
<property name="debuglevel" value="source,lines,vars"/>
34
35
<!-- default version and SCM information -->
36
<property name="base.version" value="4.0.5"/>
37
<property name="scm.connection" value="scm:https://gitbox.apache.org/repos/asf/cassandra.git"/>
38
<property name="scm.developerConnection" value="scm:https://gitbox.apache.org/repos/asf/cassandra.git"/>
39
<property name="scm.url" value="https://gitbox.apache.org/repos/asf?p=cassandra.git;a=tree"/>
40
41
<!-- directory details -->
42
<property name="basedir" value="."/>
43
<property name="build.src" value="${basedir}/src"/>
44
<property name="build.src.java" value="${basedir}/src/java"/>
45
<property name="build.src.antlr" value="${basedir}/src/antlr"/>
46
<property name="build.src.resources" value="${basedir}/src/resources"/>
47
<property name="build.src.gen-java" value="${basedir}/src/gen-java"/>
48
<property name="build.lib" value="${basedir}/lib"/>
49
<property name="build.dir" value="${basedir}/build"/>
50
<property name="build.dir.lib" value="${basedir}/build/lib"/>
51
<property name="build.test.dir" value="${build.dir}/test"/>
52
<property name="build.classes" value="${build.dir}/classes"/>
53
<property name="build.classes.main" value="${build.classes}/main" />
54
<property name="javadoc.dir" value="${build.dir}/javadoc"/>
55
<property name="interface.dir" value="${basedir}/interface"/>
56
<property name="test.dir" value="${basedir}/test"/>
57
<property name="test.resources" value="${test.dir}/resources"/>
58
<property name="test.lib" value="${build.dir}/test/lib"/>
59
<property name="test.classes" value="${build.dir}/test/classes"/>
60
<property name="test.conf" value="${test.dir}/conf"/>
61
<property name="test.data" value="${test.dir}/data"/>
62
<property name="test.name" value="*Test"/>
63
<property name="test.classlistfile" value="testlist.txt"/>
64
<property name="test.classlistprefix" value="unit"/>
65
<property name="benchmark.name" value=""/>
66
<property name="test.methods" value=""/>
67
<property name="test.unit.src" value="${test.dir}/unit"/>
68
<property name="test.long.src" value="${test.dir}/long"/>
69
<property name="test.burn.src" value="${test.dir}/burn"/>
70
<property name="test.memory.src" value="${test.dir}/memory"/>
71
<property name="test.microbench.src" value="${test.dir}/microbench"/>
72
<property name="test.distributed.src" value="${test.dir}/distributed"/>
73
<property name="test.compression.algo" value="LZ4"/>
74
<property name="test.driver.connection_timeout_ms" value="5000"/>
75
<property name="test.driver.read_timeout_ms" value="12000"/>
76
<property name="dist.dir" value="${build.dir}/dist"/>
77
<property name="tmp.dir" value="${java.io.tmpdir}"/>
78
79
<property name="doc.dir" value="${basedir}/doc"/>
80
81
<condition property="version" value="${base.version}">
82
<isset property="release"/>
83
</condition>
84
<property name="version" value="${base.version}-SNAPSHOT"/>
85
<property name="version.properties.dir"
86
value="${build.src.resources}/org/apache/cassandra/config/" />
87
<property name="final.name" value="${ant.project.name}-${version}"/>
88
89
<property name="local.repository" value="${user.home}/.m2/repository" />
90
91
<!-- details of what version of Maven ANT Tasks to fetch -->
92
<property name="maven-ant-tasks.version" value="2.1.3" />
93
<property name="maven-ant-tasks.local" value="${local.repository}/org/apache/maven/maven-ant-tasks"/>
94
<property name="maven-ant-tasks.url"
95
value="https://repo.maven.apache.org/maven2/org/apache/maven/maven-ant-tasks" />
96
<!-- details of how and which Maven repository we publish to -->
97
<property name="maven.version" value="3.0.3" />
98
<condition property="maven-repository-url" value="https://repository.apache.org/service/local/staging/deploy/maven2">
99
<isset property="release"/>
100
</condition>
101
<condition property="maven-repository-id" value="apache.releases.https">
102
<isset property="release"/>
103
</condition>
104
<property name="maven-repository-url" value="https://repository.apache.org/content/repositories/snapshots"/>
105
<property name="maven-repository-id" value="apache.snapshots.https"/>
106
107
<property name="test.timeout" value="240000" />
108
<property name="test.memory.timeout" value="480000" />
109
<property name="test.long.timeout" value="600000" />
110
<property name="test.burn.timeout" value="60000000" />
111
<property name="test.distributed.timeout" value="900000" />
112
113
<!-- default for cql tests. Can be override by -Dcassandra.test.use_prepared=false -->
114
<property name="cassandra.test.use_prepared" value="true" />
115
116
<!-- skip flushing schema tables during tests -->
117
<property name="cassandra.test.flush_local_schema_changes" value="false" />
118
119
<!-- https://www.eclemma.org/jacoco/ -->
120
<property name="jacoco.export.dir" value="${build.dir}/jacoco/" />
121
<property name="jacoco.partials.dir" value="${jacoco.export.dir}/partials" />
122
<property name="jacoco.partialexecfile" value="${jacoco.partials.dir}/partial.exec" />
123
<property name="jacoco.finalexecfile" value="${jacoco.export.dir}/jacoco.exec" />
124
<property name="jacoco.version" value="0.8.6"/>
125
126
<property name="byteman.version" value="4.0.6"/>
127
<property name="jamm.version" value="0.3.2"/>
128
<property name="ecj.version" value="4.6.1"/>
129
<property name="ohc.version" value="0.5.1"/>
130
<property name="asm.version" value="7.1"/>
131
<property name="allocation-instrumenter.version" value="3.1.0"/>
132
<property name="bytebuddy.version" value="1.10.10"/>
133
<property name="jflex.version" value="1.8.2"/>
134
135
<!-- https://mvnrepository.com/artifact/net.openhft/chronicle-bom/1.16.23 -->
136
<property name="chronicle-queue.version" value="5.20.123" />
137
<property name="chronicle-core.version" value="2.20.126" />
138
<property name="chronicle-bytes.version" value="2.20.111" />
139
<property name="chronicle-wire.version" value="2.20.117" />
140
<property name="chronicle-threads.version" value="2.20.111" />
141
142
<condition property="maven-ant-tasks.jar.exists">
143
<available file="${build.dir}/maven-ant-tasks-${maven-ant-tasks.version}.jar" />
144
</condition>
145
146
<condition property="maven-ant-tasks.jar.local">
147
<available file="${maven-ant-tasks.local}/${maven-ant-tasks.version}/maven-ant-tasks-${maven-ant-tasks.version}.jar" />
148
</condition>
149
150
<condition property="is.source.artifact">
151
<available file="${build.src.java}" type="dir" />
152
</condition>
153
154
<!-- Check if all tests are being run or just one. If it's all tests don't spam the console with test output.
155
If it's an individual test print the output from the test under the assumption someone is debugging the test
156
and wants to know what is going on without having to context switch to the log file that is generated.
157
Debug level output still needs to be retrieved from the log file. -->
158
<script language="javascript">
159
if (project.getProperty("cassandra.keepBriefBrief") == null)
160
{
161
if (project.getProperty("test.name").equals("*Test"))
162
project.setProperty("cassandra.keepBriefBrief", "true");
163
else
164
project.setProperty("cassandra.keepBriefBrief", "false");
165
}
166
</script>
167
168
<condition property="java.version.8">
169
<equals arg1="${ant.java.version}" arg2="1.8"/>
170
</condition>
171
<condition property="java.version.11">
172
<not><isset property="java.version.8"/></not>
173
</condition>
174
<fail><condition><not><or>
175
<isset property="java.version.8"/>
176
<isset property="java.version.11"/>
177
</or></not></condition></fail>
178
179
<resources id="_jvm11_arg_items">
180
<string>-Djdk.attach.allowAttachSelf=true</string>
181
182
<string>-XX:+UseConcMarkSweepGC</string>
183
<string>-XX:+CMSParallelRemarkEnabled</string>
184
<string>-XX:SurvivorRatio=8</string>
185
<string>-XX:MaxTenuringThreshold=1</string>
186
<string>-XX:CMSInitiatingOccupancyFraction=75</string>
187
<string>-XX:+UseCMSInitiatingOccupancyOnly</string>
188
<string>-XX:CMSWaitDuration=10000</string>
189
<string>-XX:+CMSParallelInitialMarkEnabled</string>
190
<string>-XX:+CMSEdenChunksRecordAlways</string>
191
192
<string>--add-exports java.base/jdk.internal.misc=ALL-UNNAMED</string>
193
<string>--add-exports java.base/jdk.internal.ref=ALL-UNNAMED</string>
194
<string>--add-exports java.base/sun.nio.ch=ALL-UNNAMED</string>
195
<string>--add-exports java.management.rmi/com.sun.jmx.remote.internal.rmi=ALL-UNNAMED</string>
196
<string>--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED</string>
197
<string>--add-exports java.rmi/sun.rmi.server=ALL-UNNAMED</string>
198
<string>--add-exports java.sql/java.sql=ALL-UNNAMED</string>
199
200
<string>--add-opens java.base/java.lang.module=ALL-UNNAMED</string>
201
<string>--add-opens java.base/java.net=ALL-UNNAMED</string>
202
<string>--add-opens java.base/jdk.internal.loader=ALL-UNNAMED</string>
203
<string>--add-opens java.base/jdk.internal.ref=ALL-UNNAMED</string>
204
<string>--add-opens java.base/jdk.internal.reflect=ALL-UNNAMED</string>
205
<string>--add-opens java.base/jdk.internal.math=ALL-UNNAMED</string>
206
<string>--add-opens java.base/jdk.internal.module=ALL-UNNAMED</string>
207
<string>--add-opens java.base/jdk.internal.util.jar=ALL-UNNAMED</string>
208
<string>--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED</string>
209
</resources>
210
<pathconvert property="_jvm_args_concat" refid="_jvm11_arg_items" pathsep=" "/>
211
<condition property="java11-jvmargs" value="${_jvm_args_concat}" else="">
212
<not>
213
<equals arg1="${ant.java.version}" arg2="1.8"/>
214
</not>
215
</condition>
216
217
<!--
218
JVM arguments for tests.
219
220
There is a race condition bug in java 11 (see CASSANDRA-15981) which causes a crash of the
221
JVM; this race is between CMS and class unloading. In java 8 we can cap the metaspace to
222
make tests stable on low resource environments, but in java 11 we need to make it unlimited
223
(don't define MaxMetaspaceSize) and disable class unloading in CMS outside of a
224
stop-the-world pause.
225
226
In java 11 we also need to set a system property to enable netty to use Unsafe direct byte
227
buffer construction (see CASSANDRA-16493)
228
-->
229
<resources id="_jvm8_test_arg_items">
230
<!-- 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
231
<string>-XX:MaxMetaspaceExpansion=64M</string>
232
<string>-XX:MaxMetaspaceSize=512M</string>
233
<string>-XX:MetaspaceSize=128M</string>
234
-->
235
</resources>
236
<pathconvert property="_jvm8_test_arg_items_concat" refid="_jvm8_test_arg_items" pathsep=" "/>
237
<resources id="_jvm11_test_arg_items">
238
<string>-XX:-CMSClassUnloadingEnabled</string>
239
<string>-Dio.netty.tryReflectionSetAccessible=true</string>
240
</resources>
241
<pathconvert property="_jvm11_test_arg_items_concat" refid="_jvm11_test_arg_items" pathsep=" "/>
242
<condition property="test-jvmargs" value="${_jvm11_test_arg_items_concat}" else="${_jvm8_test_arg_items_concat}">
243
<not>
244
<equals arg1="${ant.java.version}" arg2="1.8"/>
245
</not>
246
</condition>
247
248
<!-- needed to compile org.apache.cassandra.utils.JMXServerUtils -->
249
<condition property="jdk11-javac-exports" value="--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED" else="">
250
<not>
251
<equals arg1="${ant.java.version}" arg2="1.8"/>
252
</not>
253
</condition>
254
<condition property="jdk11-javadoc-exports" value="${jdk11-javac-exports} --frames" else="">
255
<not>
256
<equals arg1="${ant.java.version}" arg2="1.8"/>
257
</not>
258
</condition>
259
260
<condition property="build.java.11">
261
<istrue value="${use.jdk11}"/>
262
</condition>
263
264
<condition property="source.version" value="8" else="11">
265
<equals arg1="${java.version.8}" arg2="true"/>
266
</condition>
267
<condition property="target.version" value="8" else="11">
268
<equals arg1="${java.version.8}" arg2="true"/>
269
</condition>
270
271
<!--
272
Add all the dependencies.
273
-->
274
<path id="maven-ant-tasks.classpath" path="${build.dir}/maven-ant-tasks-${maven-ant-tasks.version}.jar" />
275
<path id="cassandra.classpath">
276
<pathelement location="${build.classes.main}" />
277
<fileset dir="${build.dir.lib}">
278
<include name="**/*.jar" />
279
</fileset>
280
</path>
281
<path id="cassandra.classpath.test">
282
<file file="${build.dir}/${final.name}.jar"/> <!-- we need the jar for tests and benchmarks (multi-version jar) -->
283
<fileset dir="${build.dir.lib}">
284
<include name="**/*.jar" />
285
</fileset>
286
<fileset dir="${test.lib}/jars">
287
<include name="**/*.jar" />
288
<exclude name="**/ant-*.jar"/>
289
</fileset>
290
</path>
291
292
<macrodef name="create-javadoc">
293
<attribute name="destdir"/>
294
<element name="filesets"/>
295
<sequential>
296
<javadoc destdir="@{destdir}" author="true" version="true" use="true"
297
windowtitle="${ant.project.name} API" classpathref="cassandra.classpath"
298
bottom="Copyright &amp;copy; 2009-2022 The Apache Software Foundation"
299
useexternalfile="yes" encoding="UTF-8" failonerror="false"
300
maxmemory="256m" additionalparam="${jdk11-javadoc-exports}">
301
<filesets/>
302
</javadoc>
303
<fail message="javadoc failed">
304
<condition>
305
<not>
306
<available file="@{destdir}/index-all.html" />
307
</not>
308
</condition>
309
</fail>
310
</sequential>
311
</macrodef>
312
313
<target name="validate-build-conf">
314
<condition property="use-jdk11">
315
<or>
316
<isset property="build.java.11"/>
317
<istrue value="${env.CASSANDRA_USE_JDK11}"/>
318
</or>
319
</condition>
320
<fail message="Inconsistent JDK11 options set">
321
<condition>
322
<and>
323
<istrue value="${env.CASSANDRA_USE_JDK11}"/>
324
<isset property="use.jdk11"/>
325
<not>
326
<istrue value="${use.jdk11}"/>
327
</not>
328
</and>
329
</condition>
330
</fail>
331
<fail message="Inconsistent JDK11 options set">
332
<condition>
333
<and>
334
<isset property="env.CASSANDRA_USE_JDK11"/>
335
<not>
336
<istrue value="${env.CASSANDRA_USE_JDK11}"/>
337
</not>
338
<istrue value="${use.jdk11}"/>
339
</and>
340
</condition>
341
</fail>
342
<fail message="-Duse.jdk11=true or $CASSANDRA_USE_JDK11=true cannot be set when building from java 8">
343
<condition>
344
<not><or>
345
<not><isset property="java.version.8"/></not>
346
<not><isset property="use-jdk11"/></not>
347
</or></not>
348
</condition>
349
</fail>
350
<fail message="-Duse.jdk11=true or $CASSANDRA_USE_JDK11=true must be set when building from java 11">
351
<condition>
352
<not><or>
353
<isset property="java.version.8"/>
354
<isset property="use-jdk11"/>
355
</or></not>
356
</condition>
357
</fail>
358
</target>
359
360
<!--
361
Setup the output directories.
362
-->
363
<target name="init" depends="validate-build-conf">
364
<fail unless="is.source.artifact"
365
message="Not a source artifact, stopping here." />
366
<mkdir dir="${build.classes.main}"/>
367
<mkdir dir="${test.lib}"/>
368
<mkdir dir="${test.classes}"/>
369
<mkdir dir="${stress.test.classes}"/>
370
<mkdir dir="${fqltool.test.classes}"/>
371
<mkdir dir="${build.src.gen-java}"/>
372
<mkdir dir="${build.dir.lib}"/>
373
<mkdir dir="${jacoco.export.dir}"/>
374
<mkdir dir="${jacoco.partials.dir}"/>
375
</target>
376
377
<target name="clean" description="Remove all locally created artifacts">
378
<delete dir="${build.test.dir}" />
379
<delete dir="${build.classes}" />
380
<delete dir="${build.src.gen-java}" />
381
<delete dir="${version.properties.dir}" />
382
<delete dir="${jacoco.export.dir}" />
383
<delete dir="${jacoco.partials.dir}"/>
384
</target>
385
<target depends="clean" name="cleanall"/>
386
387
<target name="realclean" depends="clean" description="Remove the entire build directory and all downloaded artifacts">
388
<delete>
389
<fileset dir="${build.lib}" excludes="cassandra-driver-internal-only-*"/>
390
</delete>
391
<delete dir="${build.dir}" />
392
<delete dir="${doc.dir}/build" />
393
<delete dir="${doc.dir}/source/tools/nodetool" />
394
</target>
395
396
<!--
397
This generates the CQL grammar files from Cql.g
398
-->
399
<target name="check-gen-cql3-grammar">
400
<uptodate property="cql3current"
401
targetfile="${build.src.gen-java}/org/apache/cassandra/cql3/Cql.tokens">
402
<srcfiles dir="${build.src.antlr}">
403
<include name="*.g"/>
404
</srcfiles>
405
</uptodate>
406
</target>
407
408
<target name="gen-cql3-grammar" depends="check-gen-cql3-grammar" unless="cql3current">
409
<echo>Building Grammar ${build.src.antlr}/Cql.g ...</echo>
410
<java classname="org.antlr.Tool"
411
classpathref="cql3-grammar.classpath"
412
failonerror="true">
413
<arg value="-Xconversiontimeout" />
414
<arg value="10000" />
415
<arg value="${build.src.antlr}/Cql.g" />
416
<arg value="-fo" />
417
<arg value="${build.src.gen-java}/org/apache/cassandra/cql3/" />
418
<arg value="-Xmaxinlinedfastates"/>
419
<arg value="10"/> <!-- default is 60 -->
420
</java>
421
</target>
422
423
<target name="generate-cql-html" depends="resolver-init" description="Generate HTML from textile source">
424
<taskdef classpathref="wikitext.classpath" resource="wikitexttasks.properties" />
425
<wikitext-to-html markupLanguage="Textile">
426
<fileset dir="${basedir}">
427
<include name="doc/cql3/*.textile"/>
428
</fileset>
429
</wikitext-to-html>
430
</target>
431
432
<target name="gen-asciidoc" description="Generate dynamic asciidoc pages" depends="jar" unless="ant.gen-doc.skip">
433
<exec executable="make" osfamily="unix" dir="${doc.dir}">
434
<arg value="gen-asciidoc"/>
435
</exec>
436
</target>
437
438
<target name="gen-doc" description="Generate documentation" depends="gen-asciidoc,generate-cql-html" unless="ant.gen-doc.skip">
439
<exec executable="make" osfamily="unix" dir="${doc.dir}">
440
<arg value="html"/>
441
</exec>
442
</target>
443
444
<!--
445
Generates Java sources for tokenization support from jflex
446
grammar files
447
-->
448
<target name="generate-jflex-java" description="Generate Java from jflex grammar">
449
<taskdef classname="jflex.anttask.JFlexTask" classpathref="jflex.classpath" name="jflex" />
450
<jflex file="${build.src.java}/org/apache/cassandra/index/sasi/analyzer/StandardTokenizerImpl.jflex" destdir="${build.src.gen-java}/" />
451
</target>
452
453
<!--
454
Fetch Maven Ant Tasks and Cassandra's dependencies
455
These targets are intentionally free of dependencies so that they
456
can be run stand-alone from a binary release artifact.
457
-->
458
<target name="maven-ant-tasks-localrepo" unless="maven-ant-tasks.jar.exists" if="maven-ant-tasks.jar.local"
459
depends="init" description="Fetch Maven ANT Tasks from Maven Local Repository">
460
<copy file="${maven-ant-tasks.local}/${maven-ant-tasks.version}/maven-ant-tasks-${maven-ant-tasks.version}.jar"
461
tofile="${build.dir}/maven-ant-tasks-${maven-ant-tasks.version}.jar"/>
462
<property name="maven-ant-tasks.jar.exists" value="true"/>
463
</target>
464
465
<target name="maven-ant-tasks-download" depends="init,maven-ant-tasks-localrepo" unless="maven-ant-tasks.jar.exists"
466
description="Fetch Maven ANT Tasks from Maven Central Repositroy">
467
<echo>Downloading Maven ANT Tasks...</echo>
468
<get src="${maven-ant-tasks.url}/${maven-ant-tasks.version}/maven-ant-tasks-${maven-ant-tasks.version}.jar"
469
dest="${build.dir}/maven-ant-tasks-${maven-ant-tasks.version}.jar" usetimestamp="true" />
470
<copy file="${build.dir}/maven-ant-tasks-${maven-ant-tasks.version}.jar"
471
tofile="${maven-ant-tasks.local}/${maven-ant-tasks.version}/maven-ant-tasks-${maven-ant-tasks.version}.jar"/>
472
</target>
473
474
<target name="maven-ant-tasks-init" depends="maven-ant-tasks-download,resolver-init" unless="maven-ant-tasks.initialized"
475
description="Initialize Maven ANT Tasks">
476
<typedef uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
477
<property name="maven-ant-tasks.initialized" value="true"/>
478
</target>
479
480
<!-- this task defines the dependencies that will be fetched by Maven ANT Tasks
481
the dependencies are re-used for publishing artifacts to Maven Central
482
in order to keep everything consistent -->
483
<target name="maven-declare-dependencies" depends="maven-ant-tasks-init"
484
description="Define dependencies and dependency versions">
485
<!-- The parent pom defines the versions of all dependencies -->
486
<artifact:pom id="parent-pom"
487
groupId="org.apache.cassandra"
488
artifactId="cassandra-parent"
489
packaging="pom"
490
version="${version}"
491
url="https://cassandra.apache.org"
492
name="Apache Cassandra"
493
inceptionYear="2009"
494
description="The Apache Cassandra Project develops a highly scalable second-generation distributed database, bringing together Dynamo's fully distributed design and Bigtable's ColumnFamily-based data model.">
495
496
<!-- Inherit from the ASF template pom file, ref http://maven.apache.org/pom/asf/ -->
497
<parent groupId="org.apache" artifactId="apache" version="22"/>
498
<license name="The Apache Software License, Version 2.0" url="https://www.apache.org/licenses/LICENSE-2.0.txt"/>
499
<scm connection="${scm.connection}" developerConnection="${scm.developerConnection}" url="${scm.url}"/>
500
<dependencyManagement>
501
<dependency groupId="org.xerial.snappy" artifactId="snappy-java" version="1.1.2.6"/>
502
<dependency groupId="org.lz4" artifactId="lz4-java" version="1.8.0"/>
503
<dependency groupId="com.ning" artifactId="compress-lzf" version="0.8.4" scope="provided"/>
504
<dependency groupId="com.github.luben" artifactId="zstd-jni" version="1.5.0-4"/>
505
<dependency groupId="com.google.guava" artifactId="guava" version="27.0-jre">
506
<exclusion groupId="com.google.code.findbugs" artifactId="jsr305" />
507
<exclusion groupId="org.codehaus.mojo" artifactId="animal-sniffer-annotations" />
508
<exclusion groupId="com.google.guava" artifactId="listenablefuture" />
509
<exclusion groupId="com.google.guava" artifactId="failureaccess" />
510
<exclusion groupId="org.checkerframework" artifactId="checker-qual" />
511
<exclusion groupId="com.google.errorprone" artifactId="error_prone_annotations" />
512
</dependency>
513
<dependency groupId="org.hdrhistogram" artifactId="HdrHistogram" version="2.1.9"/>
514
<dependency groupId="commons-cli" artifactId="commons-cli" version="1.1"/>
515
<dependency groupId="commons-codec" artifactId="commons-codec" version="1.9"/>
516
<dependency groupId="commons-io" artifactId="commons-io" version="2.6" scope="test"/>
517
<dependency groupId="org.apache.commons" artifactId="commons-lang3" version="3.11"/>
518
<dependency groupId="org.apache.commons" artifactId="commons-math3" version="3.2"/>
519
<dependency groupId="org.antlr" artifactId="antlr" version="3.5.2" scope="provided">
520
<exclusion groupId="org.antlr" artifactId="stringtemplate"/>
521
</dependency>
522
<dependency groupId="org.antlr" artifactId="ST4" version="4.0.8"/>
523
<dependency groupId="org.antlr" artifactId="antlr-runtime" version="3.5.2">
524
<exclusion groupId="org.antlr" artifactId="stringtemplate"/>
525
</dependency>
526
<dependency groupId="org.slf4j" artifactId="slf4j-api" version="1.7.25"/>
527
<dependency groupId="org.slf4j" artifactId="log4j-over-slf4j" version="1.7.25"/>
528
<dependency groupId="org.slf4j" artifactId="jcl-over-slf4j" version="1.7.25" />
529
<dependency groupId="ch.qos.logback" artifactId="logback-core" version="1.2.9"/>
530
<dependency groupId="ch.qos.logback" artifactId="logback-classic" version="1.2.9"/>
531
<dependency groupId="com.fasterxml.jackson.core" artifactId="jackson-core" version="2.13.2"/>
532
<dependency groupId="com.fasterxml.jackson.core" artifactId="jackson-databind" version="2.13.2.2"/>
533
<dependency groupId="com.fasterxml.jackson.core" artifactId="jackson-annotations" version="2.13.2"/>
534
<dependency groupId="com.googlecode.json-simple" artifactId="json-simple" version="1.1"/>
535
<dependency groupId="com.boundary" artifactId="high-scale-lib" version="1.0.6"/>
536
<dependency groupId="com.github.jbellis" artifactId="jamm" version="${jamm.version}"/>
537
<dependency groupId="org.yaml" artifactId="snakeyaml" version="1.26"/>
538
<dependency groupId="junit" artifactId="junit" version="4.12" scope="test">
539
<exclusion groupId="org.hamcrest" artifactId="hamcrest-core"/>
540
</dependency>
541
<dependency groupId="org.mockito" artifactId="mockito-core" version="3.2.4" scope="test"/>
542
<dependency groupId="org.quicktheories" artifactId="quicktheories" version="0.26" scope="test"/>
543
<dependency groupId="com.google.code.java-allocation-instrumenter" artifactId="java-allocation-instrumenter" version="${allocation-instrumenter.version}" scope="test">
544
<exclusion groupId="com.google.guava" artifactId="guava"/>
545
</dependency>
546
<dependency groupId="org.apache.cassandra" artifactId="dtest-api" version="0.0.13" scope="test"/>
547
<dependency groupId="org.reflections" artifactId="reflections" version="0.10.2" scope="test"/>
548
<dependency groupId="org.apache.hadoop" artifactId="hadoop-core" version="1.0.3" scope="provided">
549
<exclusion groupId="org.mortbay.jetty" artifactId="servlet-api"/>
550
<exclusion groupId="commons-logging" artifactId="commons-logging"/>
551
<exclusion groupId="org.eclipse.jdt" artifactId="core"/>
552
<exclusion groupId="ant" artifactId="ant"/>
553
<exclusion groupId="junit" artifactId="junit"/>
554
<exclusion groupId="org.codehaus.jackson" artifactId="jackson-mapper-asl"/>
555
<exclusion groupId="org.slf4j" artifactId="slf4j-api"/>
556
</dependency>
557
<dependency groupId="org.apache.hadoop" artifactId="hadoop-minicluster" version="1.0.3" scope="provided">
558
<exclusion groupId="asm" artifactId="asm"/> <!-- this is the outdated version 3.1 -->
559
<exclusion groupId="org.slf4j" artifactId="slf4j-api"/>
560
<exclusion groupId="org.codehaus.jackson" artifactId="jackson-mapper-asl"/>
561
</dependency>
562
<dependency groupId="net.java.dev.jna" artifactId="jna" version="5.6.0"/>
563
564
<dependency groupId="org.jacoco" artifactId="org.jacoco.agent" version="${jacoco.version}" scope="test"/>
565
<dependency groupId="org.jacoco" artifactId="org.jacoco.ant" version="${jacoco.version}" scope="test"/>
566
567
<dependency groupId="org.jboss.byteman" artifactId="byteman-install" version="${byteman.version}" scope="provided"/>
568
<dependency groupId="org.jboss.byteman" artifactId="byteman" version="${byteman.version}" scope="provided"/>
569
<dependency groupId="org.jboss.byteman" artifactId="byteman-submit" version="${byteman.version}" scope="provided"/>
570
<dependency groupId="org.jboss.byteman" artifactId="byteman-bmunit" version="${byteman.version}" scope="provided"/>
571
572
<dependency groupId="net.bytebuddy" artifactId="byte-buddy" version="${bytebuddy.version}" />
573
<dependency groupId="net.bytebuddy" artifactId="byte-buddy-agent" version="${bytebuddy.version}" />
574
575
<dependency groupId="org.openjdk.jmh" artifactId="jmh-core" version="1.21" scope="test"/>
576
<dependency groupId="org.openjdk.jmh" artifactId="jmh-generator-annprocess" version="1.21" scope="test"/>
577
578
<dependency groupId="org.apache.ant" artifactId="ant-junit" version="1.10.12" scope="test"/>
579
580
<dependency groupId="org.apache.cassandra" artifactId="cassandra-all" version="${version}" />
581
<dependency groupId="io.dropwizard.metrics" artifactId="metrics-core" version="3.1.5" />
582
<dependency groupId="io.dropwizard.metrics" artifactId="metrics-jvm" version="3.1.5" />
583
<dependency groupId="io.dropwizard.metrics" artifactId="metrics-logback" version="3.1.5" />
584
<dependency groupId="com.addthis.metrics" artifactId="reporter-config3" version="3.0.3">
585
<exclusion groupId="org.hibernate" artifactId="hibernate-validator" />
586
</dependency>
587
<dependency groupId="org.mindrot" artifactId="jbcrypt" version="0.4" />
588
<dependency groupId="io.airlift" artifactId="airline" version="0.8">
589
<exclusion groupId="com.google.code.findbugs" artifactId="jsr305" />
590
</dependency>
591
<dependency groupId="io.netty" artifactId="netty-bom" version="4.1.58.Final" type="pom" scope="provided"/>
592
<dependency groupId="io.netty" artifactId="netty-all" version="4.1.58.Final" />
593
<dependency groupId="io.netty" artifactId="netty-tcnative-boringssl-static" version="2.0.36.Final"/>
594
<dependency groupId="net.openhft" artifactId="chronicle-queue" version="${chronicle-queue.version}">
595
<exclusion groupId="com.sun" artifactId="tools" />
596
</dependency>
597
<dependency groupId="net.openhft" artifactId="chronicle-core" version="${chronicle-core.version}">
598
<exclusion groupId="net.openhft" artifactId="chronicle-analytics" />
599
<exclusion groupId="org.jetbrains" artifactId="annotations" />
600
</dependency>
601
<dependency groupId="net.openhft" artifactId="chronicle-bytes" version="${chronicle-bytes.version}">
602
<exclusion groupId="org.jetbrains" artifactId="annotations" />
603
</dependency>
604
<dependency groupId="net.openhft" artifactId="chronicle-wire" version="${chronicle-wire.version}">
605
<exclusion groupId="net.openhft" artifactId="compiler" />
606
</dependency>
607
<dependency groupId="net.openhft" artifactId="chronicle-threads" version="${chronicle-threads.version}">
608
<exclusion groupId="net.openhft" artifactId="affinity" />
609
<!-- Exclude JNA here, as we want to avoid breaking consumers of the cassandra-all jar -->
610
<exclusion groupId="net.java.dev.jna" artifactId="jna" />
611
<exclusion groupId="net.java.dev.jna" artifactId="jna-platform" />
612
</dependency>
613
<dependency groupId="com.google.code.findbugs" artifactId="jsr305" version="2.0.2" scope="provided"/>
614
<dependency groupId="com.clearspring.analytics" artifactId="stream" version="2.5.2">
615
<exclusion groupId="it.unimi.dsi" artifactId="fastutil" />
616
</dependency>
617
<dependency groupId="com.datastax.cassandra" artifactId="cassandra-driver-core" version="3.11.0" classifier="shaded">
618
<exclusion groupId="io.netty" artifactId="netty-buffer"/>
619
<exclusion groupId="io.netty" artifactId="netty-codec"/>
620
<exclusion groupId="io.netty" artifactId="netty-handler"/>
621
<exclusion groupId="io.netty" artifactId="netty-transport"/>
622
<exclusion groupId="org.slf4j" artifactId="slf4j-api"/>
623
<exclusion groupId="com.github.jnr" artifactId="jnr-ffi"/>
624
<exclusion groupId="com.github.jnr" artifactId="jnr-posix"/>
625
</dependency>
626
<dependency groupId="org.eclipse.jdt.core.compiler" artifactId="ecj" version="${ecj.version}" />
627
<dependency groupId="org.caffinitas.ohc" artifactId="ohc-core" version="${ohc.version}">
628
<exclusion groupId="org.slf4j" artifactId="slf4j-api"/>
629
</dependency>
630
<dependency groupId="org.caffinitas.ohc" artifactId="ohc-core-j8" version="${ohc.version}" />
631
<dependency groupId="net.ju-n.compile-command-annotations" artifactId="compile-command-annotations" version="1.2.0" scope="provided"/>
632
<dependency groupId="org.fusesource" artifactId="sigar" version="1.6.4">
633
<exclusion groupId="log4j" artifactId="log4j"/>
634
</dependency>
635
<dependency groupId="com.carrotsearch" artifactId="hppc" version="0.8.1" />
636
<dependency groupId="de.jflex" artifactId="jflex" version="${jflex.version}">
637
<exclusion groupId="org.apache.ant" artifactId="ant"/>
638
</dependency>
639
<dependency groupId="com.github.rholder" artifactId="snowball-stemmer" version="1.3.0.581.1" />
640
<dependency groupId="com.googlecode.concurrent-trees" artifactId="concurrent-trees" version="2.4.0" />
641
<dependency groupId="com.github.ben-manes.caffeine" artifactId="caffeine" version="2.5.6" />
642
<dependency groupId="org.jctools" artifactId="jctools-core" version="3.1.0"/>
643
<dependency groupId="org.ow2.asm" artifactId="asm" version="${asm.version}"/>
644
<dependency groupId="org.ow2.asm" artifactId="asm-tree" version="${asm.version}" scope="test"/>
645
<dependency groupId="org.ow2.asm" artifactId="asm-commons" version="${asm.version}" scope="test"/>
646
<dependency groupId="org.gridkit.jvmtool" artifactId="sjk-cli" version="0.14"/>
647
<dependency groupId="org.gridkit.jvmtool" artifactId="sjk-core" version="0.14">
648
<exclusion groupId="org.gridkit.jvmtool" artifactId="sjk-hflame"/>
649
<exclusion groupId="org.perfkit.sjk.parsers" artifactId="sjk-hflame"/>
650
<exclusion groupId="org.perfkit.sjk.parsers" artifactId="sjk-jfr-standalone"/>
651
<exclusion groupId="org.perfkit.sjk.parsers" artifactId="sjk-nps"/>
652
<exclusion groupId="org.perfkit.sjk.parsers" artifactId="sjk-jfr5"/>
653
<exclusion groupId="org.perfkit.sjk.parsers" artifactId="sjk-jfr6"/>
654
</dependency>
655
<dependency groupId="org.gridkit.jvmtool" artifactId="sjk-stacktrace" version="0.14"/>
656
<dependency groupId="org.gridkit.jvmtool" artifactId="mxdump" version="0.14"/>
657
<dependency groupId="org.gridkit.lab" artifactId="jvm-attach-api" version="1.5"/>
658
<dependency groupId="org.gridkit.jvmtool" artifactId="sjk-json" version="0.14"/>
659
<dependency groupId="com.beust" artifactId="jcommander" version="1.30"/>
660
<dependency groupId="org.psjava" artifactId="psjava" version="0.1.19"/>
661
<dependency groupId="javax.inject" artifactId="javax.inject" version="1"/>
662
<dependency groupId="com.google.j2objc" artifactId="j2objc-annotations" version="1.3"/>
663
<!-- adding this dependency is necessary for assertj. When updating assertj, need to also update the version of
664
this that the new assertj's `assertj-parent-pom` depends on. -->
665
<dependency groupId="org.junit" artifactId="junit-bom" version="5.6.0" type="pom" scope="test"/>
666
<!-- when updating assertj, make sure to also update the corresponding junit-bom dependency -->
667
<dependency groupId="org.assertj" artifactId="assertj-core" version="3.15.0" scope="provided"/>
668
<dependency groupId="org.awaitility" artifactId="awaitility" version="4.0.3" scope="test">
669
<exclusion groupId="org.hamcrest" artifactId="hamcrest"/>
670
</dependency>
671
<dependency groupId="org.hamcrest" artifactId="hamcrest" version="2.2" scope="test"/>
672
</dependencyManagement>
673
<developer id="adelapena" name="Andres de la Peña"/>
674
<developer id="alakshman" name="Avinash Lakshman"/>
675
<developer id="aleksey" name="Aleksey Yeschenko"/>
676
<developer id="amorton" name="Aaron Morton"/>
677
<developer id="aweisberg" name="Ariel Weisberg"/>
678
<developer id="bdeggleston" name="Blake Eggleston"/>
679
<developer id="benedict" name="Benedict Elliott Smith"/>
680
<developer id="benjamin" name="Benjamin Lerer"/>
681
<developer id="blambov" name="Branimir Lambov"/>
682
<developer id="brandonwilliams" name="Brandon Williams"/>
683
<developer id="carl" name="Carl Yeksigian"/>
684
<developer id="dbrosius" name="David Brosiusd"/>
685
<developer id="dikang" name="Dikang Gu"/>
686
<developer id="eevans" name="Eric Evans"/>
687
<developer id="edimitrova" name="Ekaterina Dimitrova"/>
688
<developer id="gdusbabek" name="Gary Dusbabek"/>
689
<developer id="goffinet" name="Chris Goffinet"/>
690
<developer id="ifesdjeen" name="Alex Petrov"/>
691
<developer id="jaakko" name="Laine Jaakko Olavi"/>
692
<developer id="jake" name="T Jake Luciani"/>
693
<developer id="jasonbrown" name="Jason Brown"/>
694
<developer id="jbellis" name="Jonathan Ellis"/>
695
<developer id="jfarrell" name="Jake Farrell"/>
696
<developer id="jjirsa" name="Jeff Jirsa"/>
697
<developer id="jkni" name="Joel Knighton"/>
698
<developer id="jmckenzie" name="Josh McKenzie"/>
699
<developer id="johan" name="Johan Oskarsson"/>
700
<developer id="junrao" name="Jun Rao"/>
701
<developer id="jzhuang" name="Jay Zhuang"/>
702
<developer id="kohlisankalp" name="Sankalp Kohli"/>
703
<developer id="marcuse" name="Marcus Eriksson"/>
704
<developer id="mck" name="Michael Semb Wever"/>
705
<developer id="mishail" name="Mikhail Stepura"/>
706
<developer id="mshuler" name="Michael Shuler"/>
707
<developer id="paulo" name="Paulo Motta"/>
708
<developer id="pmalik" name="Prashant Malik"/>
709
<developer id="rstupp" name="Robert Stupp"/>
710
<developer id="scode" name="Peter Schuller"/>
711
<developer id="beobal" name="Sam Tunnicliffe"/>
712
<developer id="slebresne" name="Sylvain Lebresne"/>
713
<developer id="stefania" name="Stefania Alborghetti"/>
714
<developer id="tylerhobbs" name="Tyler Hobbs"/>
715
<developer id="vijay" name="Vijay Parthasarathy"/>
716
<developer id="xedin" name="Pavel Yaskevich"/>
717
<developer id="yukim" name="Yuki Morishita"/>
718
<developer id="zznate" name="Nate McCall"/>
719
</artifact:pom>
720
721
<!-- each dependency set then defines the subset of the dependencies for that dependency set -->
722
<artifact:pom id="build-deps-pom"
723
artifactId="cassandra-build-deps">
724
<parent groupId="org.apache.cassandra"
725
artifactId="cassandra-parent"
726
version="${version}"
727
relativePath="${final.name}-parent.pom"/>
728
<dependency groupId="junit" artifactId="junit"/>
729
<dependency groupId="commons-io" artifactId="commons-io"/>
730
<dependency groupId="org.mockito" artifactId="mockito-core"/>
731
<dependency groupId="org.quicktheories" artifactId="quicktheories"/>
732
<dependency groupId="org.reflections" artifactId="reflections"/>
733
<dependency groupId="com.google.code.java-allocation-instrumenter" artifactId="java-allocation-instrumenter" version="${allocation-instrumenter.version}"/>
734
<dependency groupId="org.apache.cassandra" artifactId="dtest-api"/>
735
<dependency groupId="org.openjdk.jmh" artifactId="jmh-core"/>
736
<dependency groupId="org.openjdk.jmh" artifactId="jmh-generator-annprocess"/>
737
<dependency groupId="org.apache.ant" artifactId="ant-junit"/>
738
<!-- adding this dependency is necessary for assertj. When updating assertj, need to also update the version of
739
this that the new assertj's `assertj-parent-pom` depends on. -->
740
<dependency groupId="org.junit" artifactId="junit-bom" type="pom"/>
741
<dependency groupId="org.awaitility" artifactId="awaitility"/>
742
<dependency groupId="org.hamcrest" artifactId="hamcrest"/>
743
<!-- coverage debs -->
744
<dependency groupId="org.jacoco" artifactId="org.jacoco.agent"/>
745
<dependency groupId="org.jacoco" artifactId="org.jacoco.ant"/>
746
</artifact:pom>
747
748
<!-- now the pom's for artifacts being deployed to Maven Central -->
749
<artifact:pom id="all-pom"
750
artifactId="cassandra-all"
751
url="https://cassandra.apache.org"
752
name="Apache Cassandra">
753
<parent groupId="org.apache.cassandra"
754
artifactId="cassandra-parent"
755
version="${version}"
756
relativePath="${final.name}-parent.pom"/>
757
<scm connection="${scm.connection}" developerConnection="${scm.developerConnection}" url="${scm.url}"/>
758
<dependency groupId="org.xerial.snappy" artifactId="snappy-java"/>
759
<dependency groupId="org.lz4" artifactId="lz4-java"/>
760
<dependency groupId="com.ning" artifactId="compress-lzf"/>
761
<dependency groupId="com.google.guava" artifactId="guava"/>
762
<dependency groupId="commons-cli" artifactId="commons-cli"/>
763
<dependency groupId="commons-codec" artifactId="commons-codec"/>
764
<dependency groupId="org.apache.commons" artifactId="commons-lang3"/>
765
<dependency groupId="org.apache.commons" artifactId="commons-math3"/>
766
<dependency groupId="org.antlr" artifactId="antlr" scope="provided"/>
767
<dependency groupId="org.antlr" artifactId="ST4"/>
768
<dependency groupId="org.antlr" artifactId="antlr-runtime"/>
769
<dependency groupId="org.slf4j" artifactId="slf4j-api"/>
770
<dependency groupId="org.slf4j" artifactId="log4j-over-slf4j"/>
771
<dependency groupId="org.slf4j" artifactId="jcl-over-slf4j"/>
772
<dependency groupId="com.fasterxml.jackson.core" artifactId="jackson-core"/>
773
<dependency groupId="com.fasterxml.jackson.core" artifactId="jackson-databind"/>
774
<dependency groupId="com.fasterxml.jackson.core" artifactId="jackson-annotations"/>
775
<dependency groupId="com.googlecode.json-simple" artifactId="json-simple"/>
776
<dependency groupId="com.boundary" artifactId="high-scale-lib"/>
777
<dependency groupId="org.yaml" artifactId="snakeyaml"/>
778
<dependency groupId="org.mindrot" artifactId="jbcrypt"/>
779
<dependency groupId="io.airlift" artifactId="airline"/>
780
<dependency groupId="io.dropwizard.metrics" artifactId="metrics-core"/>
781
<dependency groupId="io.dropwizard.metrics" artifactId="metrics-jvm"/>
782
<dependency groupId="io.dropwizard.metrics" artifactId="metrics-logback"/>
783
<dependency groupId="com.addthis.metrics" artifactId="reporter-config3"/>
784
<dependency groupId="com.clearspring.analytics" artifactId="stream"/>
785
786
<dependency groupId="ch.qos.logback" artifactId="logback-core"/>
787
<dependency groupId="ch.qos.logback" artifactId="logback-classic"/>
788
789
<!-- don't need hadoop classes to run, but if you use the hadoop stuff -->
790
<dependency groupId="org.apache.hadoop" artifactId="hadoop-core" optional="true"/>
791
<dependency groupId="org.apache.hadoop" artifactId="hadoop-minicluster" optional="true"/>
792
793
<!-- don't need the Java Driver to run, but if you use the hadoop stuff or UDFs -->
794
<dependency groupId="com.datastax.cassandra" artifactId="cassandra-driver-core" classifier="shaded" optional="true"/>
795
<!-- don't need jna to run, but nice to have -->
796
<dependency groupId="net.java.dev.jna" artifactId="jna"/>
797
798
<!-- don't need jamm unless running a server in which case it needs to be a -javagent to be used anyway -->
799
<dependency groupId="com.github.jbellis" artifactId="jamm"/>
800
801
<dependency groupId="io.netty" artifactId="netty-bom" type="pom" />
802
<dependency groupId="io.netty" artifactId="netty-all"/>
803
<dependency groupId="net.openhft" artifactId="chronicle-queue"/>
804
<dependency groupId="net.openhft" artifactId="chronicle-core"/>
805
<dependency groupId="net.openhft" artifactId="chronicle-bytes"/>
806
<dependency groupId="net.openhft" artifactId="chronicle-wire"/>
807
<dependency groupId="net.openhft" artifactId="chronicle-threads"/>
808
<dependency groupId="org.fusesource" artifactId="sigar"/>
809
<dependency groupId="org.eclipse.jdt.core.compiler" artifactId="ecj"/>
810
<dependency groupId="org.caffinitas.ohc" artifactId="ohc-core"/>
811
<dependency groupId="org.caffinitas.ohc" artifactId="ohc-core-j8"/>
812
<dependency groupId="com.github.ben-manes.caffeine" artifactId="caffeine" />
813
<dependency groupId="org.jctools" artifactId="jctools-core"/>
814
<dependency groupId="org.ow2.asm" artifactId="asm" />
815
<dependency groupId="com.carrotsearch" artifactId="hppc" />
816
<dependency groupId="org.gridkit.jvmtool" artifactId="sjk-cli" />
817
<dependency groupId="org.gridkit.jvmtool" artifactId="sjk-core" />
818
<dependency groupId="org.gridkit.jvmtool" artifactId="sjk-stacktrace" />
819
<dependency groupId="org.gridkit.jvmtool" artifactId="mxdump" />
820
<dependency groupId="org.gridkit.lab" artifactId="jvm-attach-api" />
821
<dependency groupId="com.beust" artifactId="jcommander" />
822
<dependency groupId="org.gridkit.jvmtool" artifactId="sjk-json"/>
823
<dependency groupId="com.github.luben" artifactId="zstd-jni"/>
824
<dependency groupId="org.psjava" artifactId="psjava"/>
825
<dependency groupId="io.netty" artifactId="netty-tcnative-boringssl-static"/>
826
<dependency groupId="javax.inject" artifactId="javax.inject"/>
827
<dependency groupId="com.google.j2objc" artifactId="j2objc-annotations"/>
828
<dependency groupId="org.hdrhistogram" artifactId="HdrHistogram"/>
829
830
<!-- sasi deps -->
831
<dependency groupId="de.jflex" artifactId="jflex" />
832
<dependency groupId="com.github.rholder" artifactId="snowball-stemmer" />
833
<dependency groupId="com.googlecode.concurrent-trees" artifactId="concurrent-trees" />
834
835
<!-- compile tools -->
836
<dependency groupId="com.google.code.findbugs" artifactId="jsr305"/>
837
<dependency groupId="net.ju-n.compile-command-annotations" artifactId="compile-command-annotations"/>
838
<dependency groupId="org.assertj" artifactId="assertj-core"/>
839
<dependency groupId="org.jboss.byteman" artifactId="byteman-install"/>
840
<dependency groupId="org.jboss.byteman" artifactId="byteman"/>
841
<dependency groupId="org.jboss.byteman" artifactId="byteman-submit"/>
842
<dependency groupId="org.jboss.byteman" artifactId="byteman-bmunit"/>
843
</artifact:pom>
844
</target>
845
846
<!-- deprecated: legacy compatibility for build scripts in other repositories -->
847
<target name="maven-ant-tasks-retrieve-build" depends="resolver-retrieve-build"/>
848
849
<target name="echo-base-version">
850
<echo message="${base.version}" />
851
</target>
852
853
<!-- create properties file with C version -->
854
<target name="createVersionPropFile">
855
<taskdef name="propertyfile" classname="org.apache.tools.ant.taskdefs.optional.PropertyFile"/>
856
<mkdir dir="${version.properties.dir}"/>
857
<propertyfile file="${version.properties.dir}/version.properties">
858
<entry key="CassandraVersion" value="${version}"/>
859
</propertyfile>
860
</target>
861
862
<target name="test-run" depends="jar"
863
description="Run in test mode. Not for production use!">
864
<java classname="org.apache.cassandra.service.CassandraDaemon" fork="true">
865
<classpath>
866
<path refid="cassandra.classpath.test"/>
867
<pathelement location="${test.conf}"/>
868
</classpath>
869
<jvmarg value="-Dstorage-config=${test.conf}"/>
870
<jvmarg value="-javaagent:${build.lib}/jamm-${jamm.version}.jar" />
871
<jvmarg value="-ea"/>
872
<jvmarg line="${java11-jvmargs}"/>
873
</java>
874
</target>
875
876
<!--
877
The build target builds all the .class files
878
-->
879
<target name="build" depends="resolver-retrieve-build,build-project" description="Compile Cassandra classes"/>
880
<target name="codecoverage" depends="jacoco-run,jacoco-report" description="Create code coverage report"/>
881
882
<target name="_build_java">
883
<!-- Note: we cannot use javac's 'release' option, as that does not allow accessing sun.misc.Unsafe nor
884
Nashorn's ClassFilter class as any javac modules option is invalid for relase 8. -->
885
<echo message="Compiling for Java ${target.version}..."/>
886
<javac
887
debug="true" debuglevel="${debuglevel}" encoding="utf-8"
888
destdir="${build.classes.main}" includeantruntime="false" source="${source.version}" target="${target.version}">
889
<src path="${build.src.java}"/>
890
<src path="${build.src.gen-java}"/>
891
<compilerarg value="-XDignore.symbol.file"/>
892
<compilerarg line="${jdk11-javac-exports}"/>
893
<classpath>
894
<path refid="cassandra.classpath"/>
895
</classpath>
896
</javac>
897
</target>
898
899
<target depends="init,gen-cql3-grammar,generate-cql-html,generate-jflex-java,rat-check"
900
name="build-project">
901
<echo message="${ant.project.name}: ${ant.file}"/>
902
<!-- Order matters! -->
903
<antcall target="_build_java"/>
904
<antcall target="createVersionPropFile"/>
905
<copy todir="${build.classes.main}">
906
<fileset dir="${build.src.resources}" />
907
</copy>
908
<copy todir="${basedir}/conf" file="${build.classes.main}/META-INF/hotspot_compiler"/>
909
</target>
910
911
<!-- Stress build file -->
912
<property name="stress.build.src" value="${basedir}/tools/stress/src" />
913
<property name="stress.test.src" value="${basedir}/tools/stress/test/unit" />
914
<property name="stress.build.classes" value="${build.classes}/stress" />
915
<property name="stress.test.classes" value="${build.dir}/test/stress-classes" />
916
<property name="stress.manifest" value="${stress.build.classes}/MANIFEST.MF" />
917
918
<target name="stress-build-test" depends="stress-build" description="Compile stress tests">
919
<javac debug="true" debuglevel="${debuglevel}" destdir="${stress.test.classes}"
920
source="${source.version}" target="${target.version}"
921
includeantruntime="false" encoding="utf-8">
922
<classpath>
923
<path refid="cassandra.classpath.test"/>
924
<pathelement location="${stress.build.classes}" />
925
</classpath>
926
<src path="${stress.test.src}"/>
927
</javac>
928
</target>
929
930
<target name="stress-build" depends="build" description="build stress tool">
931
<antcall target="_stress_build"/>
932
</target>
933
934
<target name="_stress_build">
935
<mkdir dir="${stress.build.classes}" />
936
<javac compiler="modern" debug="true" debuglevel="${debuglevel}"
937
source="${source.version}" target="${target.version}"
938
encoding="utf-8" destdir="${stress.build.classes}" includeantruntime="true">
939
<src path="${stress.build.src}" />
940
<classpath>
941
<path refid="cassandra.classpath" />
942
</classpath>
943
</javac>
944
<copy todir="${stress.build.classes}">
945
<fileset dir="${stress.build.src}/resources" />
946
</copy>
947
</target>
948
949
<target name="stress-test" depends="stress-build-test, build-test" description="Runs stress tests">
950
<testmacro inputdir="${stress.test.src}"
951
timeout="${test.timeout}">
952
</testmacro>
953
</target>
954
955
<!-- Use this with an FQDN for test class, and an optional csv list of methods like this:
956
ant stress-test-some -Dtest.name=org.apache.cassandra.stress.generate.DistributionGaussianTest
957
ant stress-test-some -Dtest.name=org.apache.cassandra.stress.generate.DistributionGaussianTest -Dtest.methods=simpleGaussian
958
-->
959
<target name="stress-test-some" depends="stress-build-test, build-test" description="Runs stress tests">
960
<testmacro inputdir="${stress.test.src}"
961
timeout="${test.timeout}">
962
<test unless:blank="${test.methods}" name="${test.name}" methods="${test.methods}" outfile="build/test/output/TEST-${test.name}-${test.methods}"/>
963
<test if:blank="${test.methods}" name="${test.name}" outfile="build/test/output/TEST-${test.name}"/>
964
</testmacro>
965
</target>
966
967
<!--
968
fqltool build file
969
-->
970
<property name="fqltool.build.src" value="${basedir}/tools/fqltool/src" />
971
<property name="fqltool.test.src" value="${basedir}/tools/fqltool/test/unit" />
972
<property name="fqltool.build.classes" value="${build.classes}/fqltool" />
973
<property name="fqltool.test.classes" value="${build.dir}/test/fqltool-classes" />
974
<property name="fqltool.manifest" value="${fqltool.build.classes}/MANIFEST.MF" />
975
976
<target name="fqltool-build-test" depends="fqltool-build" description="Compile fqltool tests">
977
<javac debug="true" debuglevel="${debuglevel}" destdir="${fqltool.test.classes}"
978
source="${source.version}" target="${target.version}"
979
includeantruntime="false" encoding="utf-8">
980
<classpath>
981
<path refid="cassandra.classpath.test"/>
982
<pathelement location="${fqltool.build.classes}" />
983
</classpath>
984
<src path="${fqltool.test.src}"/>
985
</javac>
986
</target>
987
988
<target name="fqltool-build" depends="build" description="build fqltool">
989
<antcall target="_fqltool_build"/>
990
</target>
991
992
<target name="_fqltool_build">
993
<mkdir dir="${fqltool.build.classes}" />
994
<javac compiler="modern" debug="true" debuglevel="${debuglevel}"
995
source="${source.version}" target="${target.version}"
996
encoding="utf-8" destdir="${fqltool.build.classes}" includeantruntime="true">
997
<src path="${fqltool.build.src}" />
998
<classpath>
999
<path refid="cassandra.classpath" />
1000
</classpath>
1001
</javac>
1002
</target>
1003
1004
<target name="fqltool-test" depends="fqltool-build-test, build-test" description="Runs fqltool tests">
1005
<testmacro inputdir="${fqltool.test.src}"
1006
timeout="${test.timeout}">
1007
</testmacro>
1008
</target>
1009
1010
<target name="_write-poms" depends="maven-declare-dependencies">
1011
<artifact:writepom pomRefId="parent-pom" file="${build.dir}/${final.name}-parent.pom"/>
1012
<artifact:writepom pomRefId="all-pom" file="${build.dir}/${final.name}.pom"/>
1013
<artifact:writepom pomRefId="build-deps-pom" file="${build.dir}/tmp-${final.name}-deps.pom"/>
1014
</target>
1015
1016
<target name="write-poms" unless="without.maven">
1017
<antcall target="_write-poms" />
1018
</target>
1019
1020
<!--
1021
The jar target makes cassandra.jar output.
1022
-->
1023
<target name="_main-jar"
1024
depends="build"
1025
description="Assemble Cassandra JAR files">
1026
<mkdir dir="${build.classes.main}/META-INF" />
1027
<copy file="LICENSE.txt"
1028
tofile="${build.classes.main}/META-INF/LICENSE.txt"/>
1029
<copy file="NOTICE.txt"
1030
tofile="${build.classes.main}/META-INF/NOTICE.txt"/>
1031
1032
<!-- Main Jar -->
1033
<jar jarfile="${build.dir}/${final.name}.jar">
1034
<fileset dir="${build.classes.main}">
1035
</fileset>
1036
<manifest>
1037
<!-- <section name="org/apache/cassandra/infrastructure"> -->
1038
<attribute name="Multi-Release" value="true"/>
1039
<attribute name="Implementation-Title" value="Cassandra"/>
1040
<attribute name="Implementation-Version" value="${version}"/>
1041
<attribute name="Implementation-Vendor" value="Apache"/>
1042
<!-- </section> -->
1043
</manifest>
1044
</jar>
1045
</target>
1046
<target name="jar"
1047
depends="_main-jar,build-test,stress-build,fqltool-build,write-poms"
1048
description="Assemble Cassandra JAR files">
1049
<!-- Stress jar -->
1050
<manifest file="${stress.manifest}">
1051
<attribute name="Built-By" value="Pavel Yaskevich"/>
1052
<attribute name="Main-Class" value="org.apache.cassandra.stress.Stress"/>
1053
</manifest>
1054
<mkdir dir="${stress.build.classes}/META-INF" />
1055
<mkdir dir="${build.dir}/tools/lib/" />
1056
<jar destfile="${build.dir}/tools/lib/stress.jar" manifest="${stress.manifest}">
1057
<fileset dir="${stress.build.classes}"/>
1058
</jar>
1059
<!-- fqltool jar -->
1060
<manifest file="${fqltool.manifest}">
1061
<attribute name="Built-By" value="Marcus Eriksson"/>
1062
<attribute name="Main-Class" value="org.apache.cassandra.fqltool.FullQueryLogTool"/>
1063
</manifest>
1064
<mkdir dir="${fqltool.build.classes}/META-INF" />
1065
<mkdir dir="${build.dir}/tools/lib/" />
1066
<jar destfile="${build.dir}/tools/lib/fqltool.jar" manifest="${stress.manifest}">
1067
<fileset dir="${fqltool.build.classes}"/>
1068
</jar>
1069
</target>
1070
1071
<!--
1072
The javadoc-jar target makes cassandra-javadoc.jar output required for publishing to Maven central repository.
1073
-->
1074
<target name="javadoc-jar" depends="javadoc" unless="no-javadoc" description="Assemble Cassandra JavaDoc JAR file">
1075
<jar jarfile="${build.dir}/${final.name}-javadoc.jar" basedir="${javadoc.dir}"/>
1076
<!-- javadoc task always rebuilds so might as well remove the generated docs to prevent
1077
being pulled into the distribution by accident -->
1078
<delete quiet="true" dir="${javadoc.dir}"/>
1079
</target>
1080
1081
<!--
1082
The sources-jar target makes cassandra-sources.jar output required for publishing to Maven central repository.
1083
-->
1084
<target name="sources-jar" depends="init" description="Assemble Cassandra Sources JAR file">
1085
<jar jarfile="${build.dir}/${final.name}-sources.jar">
1086
<fileset dir="${build.src.java}" defaultexcludes="yes">
1087
<include name="org/apache/**/*.java"/>
1088
</fileset>
1089
<fileset dir="${build.src.gen-java}" defaultexcludes="yes">
1090
<include name="org/apache/**/*.java"/>
1091
</fileset>
1092
</jar>
1093
</target>
1094
1095
<target name="_artifacts-init" depends="jar">
1096
<mkdir dir="${dist.dir}"/>
1097
<!-- fix the control linefeed so that builds on windows works on linux -->
1098
<fixcrlf srcdir="bin" includes="**/*" eol="lf" eof="remove" />
1099
<fixcrlf srcdir="conf" includes="**/*" eol="lf" eof="remove" />
1100
<fixcrlf srcdir="tools/bin" includes="**/*" eol="lf" eof="remove" />
1101
<copy todir="${dist.dir}/lib">
1102
<fileset dir="${build.lib}"/>
1103
<fileset dir="${build.dir}">
1104
<include name="${final.name}.jar" />
1105
</fileset>
1106
</copy>
1107
<copy todir="${dist.dir}/doc" failonerror="false">
1108
<fileset dir="doc">
1109
<include name="cql3/CQL.html" />
1110
<include name="cql3/CQL.css" />
1111
<include name="SASI.md" />
1112
</fileset>
1113
</copy>
1114
<copy todir="${dist.dir}/doc/html" failonerror="false">
1115
<fileset dir="doc" />
1116
<globmapper from="build/html/*" to="*"/>
1117
</copy>
1118
<copy todir="${dist.dir}/bin">
1119
<fileset dir="bin"/>
1120
</copy>
1121
<copy todir="${dist.dir}/conf">
1122
<fileset dir="conf"/>
1123
</copy>
1124
<copy todir="${dist.dir}/pylib">
1125
<fileset dir="pylib">
1126
<include name="**" />
1127
<exclude name="**/*.pyc" />
1128
</fileset>
1129
</copy>
1130
<copy todir="${dist.dir}/">
1131
<fileset dir="${basedir}">
1132
<include name="*.txt" />
1133
</fileset>
1134
</copy>
1135
<copy todir="${dist.dir}/tools/bin">
1136
<fileset dir="${basedir}/tools/bin"/>
1137
</copy>
1138
<copy todir="${dist.dir}/tools/">
1139
<fileset dir="${basedir}/tools/">
1140
<include name="*.yaml"/>
1141
</fileset>
1142
</copy>
1143
<copy todir="${dist.dir}/tools/lib">
1144
<fileset dir="${build.dir}/tools/lib/">
1145
<include name="*.jar" />
1146
</fileset>
1147
</copy>
1148
</target>
1149
1150
<!-- creates release tarballs -->
1151
<target name="artifacts" depends="_artifacts-init,gen-doc,sources-jar,javadoc-jar"
1152
description="Create Cassandra release artifacts">
1153
<tar compression="gzip" longfile="gnu"
1154
destfile="${build.dir}/${final.name}-bin.tar.gz">
1155
1156
<!-- Everything but bin/ (default mode) -->
1157
<tarfileset dir="${dist.dir}" prefix="${final.name}">
1158
<include name="**"/>
1159
<exclude name="bin/*" />
1160
<exclude name="tools/bin/*"/>
1161
</tarfileset>
1162
<!-- Shell includes in bin/ (default mode) -->
1163
<tarfileset dir="${dist.dir}" prefix="${final.name}">
1164
<include name="bin/*.in.sh" />
1165
<include name="tools/bin/*.in.sh" />
1166
</tarfileset>
1167
<!-- Executable scripts in bin/ -->
1168
<tarfileset dir="${dist.dir}" prefix="${final.name}" mode="755">
1169
<include name="bin/*"/>
1170
<include name="tools/bin/*"/>
1171
<exclude name="bin/*.in.sh" />
1172
<exclude name="tools/bin/*.in.sh" />
1173
</tarfileset>
1174
</tar>
1175
1176
<tar compression="gzip" longfile="gnu"
1177
destfile="${build.dir}/${final.name}-src.tar.gz">
1178
1179
<tarfileset dir="${basedir}"
1180
prefix="${final.name}-src">
1181
<include name="**"/>
1182
<exclude name="build/**" />
1183
<exclude name="lib/**" />
1184
<exclude name="src/gen-java/**" />
1185
<exclude name=".git/**" />
1186
<exclude name="venv/**" />
1187
<exclude name="src/resources/org/apache/cassandra/config/version.properties" />
1188
<exclude name="conf/hotspot_compiler" />
1189
<exclude name="doc/cql3/CQL.html" />
1190
<exclude name="doc/build/**" />
1191
<exclude name="bin/*" /> <!-- handled separately below -->
1192
<exclude name="tools/bin/*" /> <!-- handled separately below -->
1193
<!-- exclude python generated files -->
1194
<exclude name="**/__pycache__/**" />
1195
<!-- exclude Eclipse files -->
1196
<exclude name=".project" />
1197
<exclude name=".classpath" />
1198
<exclude name=".settings/**" />
1199
<exclude name=".externalToolBuilders/**" />
1200
<!-- exclude NetBeans files -->
1201
<exclude name="ide/nbproject/private/**" />
1202
</tarfileset>
1203
1204
<!-- python driver -->
1205
<tarfileset dir="${basedir}" prefix="${final.name}-src">
1206
<include name="lib/cassandra-driver-internal-only-**" />
1207
</tarfileset>
1208
1209
<!-- Shell includes in bin/ and tools/bin/ -->
1210
<tarfileset dir="${basedir}" prefix="${final.name}-src">
1211
<include name="bin/*.in.sh" />
1212
<include name="tools/bin/*.in.sh" />
1213
</tarfileset>
1214
<!-- Everything else (assumed to be scripts), is executable -->
1215
<tarfileset dir="${basedir}" prefix="${final.name}-src" mode="755">
1216
<include name="bin/*"/>
1217
<exclude name="bin/*.in.sh" />
1218
<include name="tools/bin/*"/>
1219
<exclude name="tools/bin/*.in.sh" />
1220
</tarfileset>
1221
</tar>
1222
1223
<checksum forceOverwrite="yes" todir="${build.dir}" fileext=".sha256" algorithm="SHA-256">
1224
<fileset dir="${build.dir}">
1225
<include name="${final.name}-bin.tar.gz" />
1226
<include name="${final.name}-src.tar.gz" />
1227
</fileset>
1228
</checksum>
1229
<checksum forceOverwrite="yes" todir="${build.dir}" fileext=".sha512" algorithm="SHA-512">
1230
<fileset dir="${build.dir}">
1231
<include name="${final.name}-bin.tar.gz" />
1232
<include name="${final.name}-src.tar.gz" />
1233
</fileset>
1234
</checksum>
1235
</target>
1236
1237
<target name="build-jmh" depends="build-test, jar" description="Create JMH uber jar">
1238
<jar jarfile="${build.test.dir}/deps.jar">
1239
<zipgroupfileset dir="${test.lib}/jars">
1240
<include name="*jmh*.jar"/>
1241
<include name="jopt*.jar"/>
1242
<include name="commons*.jar"/>
1243
<include name="junit*.jar"/>
1244
<include name="hamcrest*.jar"/>
1245
</zipgroupfileset>
1246
<zipgroupfileset dir="${build.lib}" includes="*.jar"/>
1247
</jar>
1248
<jar jarfile="${build.test.dir}/benchmarks.jar">
1249
<manifest>
1250
<attribute name="Main-Class" value="org.openjdk.jmh.Main"/>
1251
</manifest>
1252
<zipfileset src="${build.test.dir}/deps.jar" excludes="META-INF/*.SF" />
1253
<fileset dir="${build.classes.main}"/>
1254
<fileset dir="${test.classes}"/>
1255
<fileset dir="${test.conf}" />
1256
</jar>
1257
</target>
1258
1259
<target name="build-test" depends="_main-jar,stress-build,fqltool-build,resolver-dist-lib" unless="no-build-test"
1260
description="Compile test classes">
1261
<antcall target="_build-test"/>
1262
</target>
1263
1264
<target name="_build-test">
1265
<javac
1266
compiler="modern"
1267
debug="true"
1268
debuglevel="${debuglevel}"
1269
destdir="${test.classes}"
1270
includeantruntime="true"
1271
source="${source.version}"
1272
target="${target.version}"
1273
encoding="utf-8">
1274
<classpath>
1275
<path refid="cassandra.classpath.test"/>
1276
<pathelement location="${fqltool.build.classes}"/>
1277
</classpath>
1278
<compilerarg value="-XDignore.symbol.file"/>
1279
<src path="${test.unit.src}"/>
1280
<src path="${test.long.src}"/>
1281
<src path="${test.burn.src}"/>
1282
<src path="${test.memory.src}"/>
1283
<src path="${test.microbench.src}"/>
1284
<src path="${test.distributed.src}"/>
1285
</javac>
1286
1287
<!-- Non-java resources needed by the test suite -->
1288
<copy todir="${test.classes}">
1289
<fileset dir="${test.resources}"/>
1290
</copy>
1291
</target>
1292
1293
<!-- Run tests separately and report errors after and generate a junit report -->
1294
<macrodef name="testhelper">
1295
<attribute name="testdelegate"/>
1296
<sequential>
1297
<testhelper_ testdelegate="@{testdelegate}"/>
1298
<fail message="Some test(s) failed.">
1299
<condition>
1300
<and>
1301
<isset property="testfailed"/>
1302
<not>
1303
<isset property="ant.test.failure.ignore"/>
1304
</not>
1305
</and>
1306
</condition>
1307
</fail>
1308
</sequential>
1309
</macrodef>
1310
1311
<!-- Run a list of junit tasks but don't track errors or generate a report after
1312
If a test fails the testfailed property will be set. All the tests are run using the testdelegate
1313
macro that is specified as an attribute and they will be run sequentially in this ant process -->
1314
<scriptdef name="testhelper_" language="javascript">
1315
<attribute name="testdelegate"/>
1316
<![CDATA[
1317
sep = project.getProperty("path.separator");
1318
all = project.getProperty("all-test-classes").split(sep);
1319
var p = project.createTask('sequential');
1320
for (i = 0; i < all.length; i++) {
1321
if (all[i] == undefined) continue;
1322
task = project.createTask( attributes.get("testdelegate") );
1323
task.setDynamicAttribute( "test.file.list", "" + all[i]);
1324
p.addTask(task);
1325
}
1326
p.perform();
1327
]]>
1328
</scriptdef>
1329
1330
<!-- Defines how to run a set of tests. If you change the defaults for attributes
1331
you should also update them in testmacro.,
1332
The two are split because the helper doesn't generate
1333
a junit report or fail on errors -->
1334
<macrodef name="testmacrohelper">
1335
<attribute name="inputdir" />
1336
<attribute name="timeout" default="${test.timeout}" />
1337
<attribute name="forkmode" default="perTest"/>
1338
<element name="optjvmargs" implicit="true" optional="true" />
1339
<attribute name="filter" default="**/${test.name}.java"/>
1340
<attribute name="exclude" default="" />
1341
<attribute name="filelist" default="" />
1342
<attribute name="testtag" default=""/>
1343
<attribute name="usejacoco" default="no"/>
1344
<attribute name="showoutput" default="false"/>
1345
1346
<sequential>
1347
<condition property="additionalagent"
1348
value="-javaagent:${build.dir.lib}/jars/jacocoagent.jar=destfile=${jacoco.partialexecfile}"
1349
else="">
1350
<istrue value="${usejacoco}"/>
1351
</condition>
1352
<taskdef name="junit-timeout" classname="org.apache.cassandra.JStackJUnitTask">
1353
<classpath>
1354
<pathelement location="${test.classes}"/>
1355
</classpath>
1356
</taskdef>
1357
<mkdir dir="${build.test.dir}/cassandra"/>
1358
<mkdir dir="${build.test.dir}/output"/>
1359
<mkdir dir="${build.test.dir}/output/@{testtag}"/>
1360
<junit-timeout fork="on" forkmode="@{forkmode}" failureproperty="testfailed" maxmemory="1024m" timeout="@{timeout}" showoutput="@{showoutput}">
1361
<formatter classname="org.apache.cassandra.CassandraXMLJUnitResultFormatter" extension=".xml" usefile="true"/>
1362
<formatter classname="org.apache.cassandra.CassandraBriefJUnitResultFormatter" usefile="false"/>
1363
<jvmarg value="-Dstorage-config=${test.conf}"/>
1364
<jvmarg value="-Djava.awt.headless=true"/>
1365
<!-- Cassandra 3.0+ needs <jvmarg line="... ${additionalagent}" /> here! (not value=) -->
1366
<jvmarg line="-javaagent:${build.lib}/jamm-${jamm.version}.jar ${additionalagent}" />
1367
<jvmarg value="-ea"/>
1368
<jvmarg value="-Djava.io.tmpdir=${tmp.dir}"/>
1369
<jvmarg value="-Dcassandra.debugrefcount=true"/>
1370
<jvmarg value="-Xss256k"/>
1371
<!-- When we do classloader manipulation SoftReferences can cause memory leaks
1372
that can OOM our test runs. The next two settings informs our GC
1373
algorithm to limit the metaspace size and clean up SoftReferences
1374
more aggressively rather than waiting. See CASSANDRA-14922 for more details.
1375
-->
1376
<jvmarg value="-XX:SoftRefLRUPolicyMSPerMB=0" />
1377
<jvmarg value="-Dcassandra.test.driver.connection_timeout_ms=${test.driver.connection_timeout_ms}"/>
1378
<jvmarg value="-Dcassandra.test.driver.read_timeout_ms=${test.driver.read_timeout_ms}"/>
1379
<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>
1380
<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>
1381
<jvmarg value="-Dcassandra.test.sstableformatdevelopment=true"/>
1382
<!-- The first time SecureRandom initializes can be slow if it blocks on /dev/random -->
1383
<jvmarg value="-Djava.security.egd=file:/dev/urandom" />
1384
<jvmarg value="-Dcassandra.testtag=@{testtag}"/>
1385
<jvmarg value="-Dcassandra.keepBriefBrief=${cassandra.keepBriefBrief}" />
1386
<jvmarg value="-Dcassandra.strict.runtime.checks=true" />
1387
<jvmarg line="${java11-jvmargs}"/>
1388
<!-- disable shrinks in quicktheories CASSANDRA-15554 -->
1389
<jvmarg value="-DQT_SHRINKS=0"/>
1390
<jvmarg line="${test-jvmargs}" />
1391
<optjvmargs/>
1392
<!-- Uncomment to debug unittest, attach debugger to port 1416 -->
1393
<!--
1394
<jvmarg line="-agentlib:jdwp=transport=dt_socket,address=localhost:1416,server=y,suspend=y" />
1395
-->
1396
<classpath>
1397
<pathelement path="${java.class.path}"/>
1398
<pathelement location="${stress.build.classes}"/>
1399
<pathelement location="${fqltool.build.classes}"/>
1400
<path refid="cassandra.classpath.test" />
1401
<pathelement location="${test.classes}"/>
1402
<pathelement location="${stress.test.classes}"/>
1403
<pathelement location="${fqltool.test.classes}"/>
1404
<pathelement location="${test.conf}"/>
1405
<fileset dir="${test.lib}">
1406
<include name="**/*.jar" />
1407
<exclude name="**/ant-*.jar"/>
1408
</fileset>
1409
</classpath>
1410
<batchtest todir="${build.test.dir}/output/@{testtag}">
1411
<fileset dir="@{inputdir}" includes="@{filter}" excludes="@{exclude}"/>
1412
<filelist dir="@{inputdir}" files="@{filelist}"/>
1413
</batchtest>
1414
</junit-timeout>
1415
1416
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/commitlog"/>
1417
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/cdc_raw"/>
1418
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/data"/>
1419
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/ssl_upload_tables"/>
1420
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/system_data"/>
1421
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/saved_caches"/>
1422
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/hints"/>
1423
</sequential>
1424
</macrodef>
1425
1426
<target name="testold" depends="build-test" description="Execute unit tests">
1427
<testmacro inputdir="${test.unit.src}" timeout="${test.timeout}">
1428
<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
1429
<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>
1430
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
1431
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
1432
<jvmarg value="-Dcassandra.skip_sync=true" />
1433
</testmacro>
1434
<fileset dir="${test.unit.src}" />
1435
</target>
1436
1437
<!-- Will not generate a junit report or fail on error -->
1438
<macrodef name="testlist">
1439
<attribute name="test.file.list"/>
1440
<sequential>
1441
<testmacrohelper inputdir="${test.dir}/${test.classlistprefix}" filelist="@{test.file.list}" exclude="**/*.java" timeout="${test.timeout}">
1442
<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
1443
<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>
1444
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
1445
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
1446
<jvmarg value="-Dcassandra.skip_sync=true" />
1447
</testmacrohelper>
1448
</sequential>
1449
</macrodef>
1450
1451
<!-- Will not generate a junit report -->
1452
<macrodef name="testlist-compression">
1453
<attribute name="test.file.list" />
1454
<sequential>
1455
<property name="compressed_yaml" value="${build.test.dir}/cassandra.compressed.yaml"/>
1456
<concat destfile="${compressed_yaml}">
1457
<fileset file="${test.conf}/cassandra.yaml"/>
1458
<fileset file="${test.conf}/commitlog_compression_${test.compression.algo}.yaml"/>
1459
</concat>
1460
<testmacrohelper inputdir="${test.unit.src}" filelist="@{test.file.list}"
1461
exclude="**/*.java" timeout="${test.timeout}" testtag="compression">
1462
<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
1463
<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>
1464
<jvmarg value="-Dcassandra.test.compression=true"/>
1465
<jvmarg value="-Dcassandra.test.compression.algo=${test.compression.algo}"/>
1466
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
1467
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
1468
<jvmarg value="-Dcassandra.config=file:///${compressed_yaml}"/>
1469
<jvmarg value="-Dcassandra.skip_sync=true" />
1470
</testmacrohelper>
1471
</sequential>
1472
</macrodef>
1473
1474
<macrodef name="testlist-cdc">
1475
<attribute name="test.file.list" />
1476
<sequential>
1477
<property name="cdc_yaml" value="${build.test.dir}/cassandra.cdc.yaml"/>
1478
<concat destfile="${cdc_yaml}">
1479
<fileset file="${test.conf}/cassandra.yaml"/>
1480
<fileset file="${test.conf}/cdc.yaml"/>
1481
</concat>
1482
<testmacrohelper inputdir="${test.unit.src}" filelist="@{test.file.list}"
1483
exclude="**/*.java" timeout="${test.timeout}" testtag="cdc">
1484
<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
1485
<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>
1486
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
1487
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
1488
<jvmarg value="-Dcassandra.config=file:///${cdc_yaml}"/>
1489
<jvmarg value="-Dcassandra.skip_sync=true" />
1490
</testmacrohelper>
1491
</sequential>
1492
</macrodef>
1493
1494
<macrodef name="testlist-system-keyspace-directory">
1495
<attribute name="test.file.list" />
1496
<sequential>
1497
<property name="system_keyspaces_directory_yaml" value="${build.test.dir}/cassandra.system.yaml"/>
1498
<concat destfile="${system_keyspaces_directory_yaml}">
1499
<fileset file="${test.conf}/cassandra.yaml"/>
1500
<fileset file="${test.conf}/system_keyspaces_directory.yaml"/>
1501
</concat>
1502
<testmacrohelper inputdir="${test.unit.src}" filelist="@{test.file.list}"
1503
exclude="**/*.java" timeout="${test.timeout}" testtag="system_keyspace_directory">
1504
<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
1505
<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>
1506
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
1507
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
1508
<jvmarg value="-Dcassandra.config=file:///${system_keyspaces_directory_yaml}"/>
1509
<jvmarg value="-Dcassandra.skip_sync=true" />
1510
</testmacrohelper>
1511
</sequential>
1512
</macrodef>
1513
1514
<!--
1515
Run named ant task with jacoco, such as "ant jacoco-run -Dtaskname=test"
1516
the target run must enable the jacoco agent if usejacoco is 'yes' -->
1517
<target name="jacoco-run" description="run named task with jacoco instrumentation">
1518
<condition property="runtask" value="${taskname}" else="test">
1519
<isset property="taskname"/>
1520
</condition>
1521
<antcall target="${runtask}">
1522
<param name="usejacoco" value="yes"/>
1523
</antcall>
1524
</target>
1525
1526
<!-- Use this with an FQDN for test class, and an optional csv list of methods like this:
1527
ant testsome -Dtest.name=org.apache.cassandra.service.StorageServiceServerTest -Dtest.methods=testRegularMode,testGetAllRangesEmpty
1528
-->
1529
<target name="testsome" depends="build-test" description="Execute specific unit tests" >
1530
<testmacro inputdir="${test.unit.src}" timeout="${test.timeout}">
1531
<test unless:blank="${test.methods}" name="${test.name}" methods="${test.methods}" outfile="build/test/output/TEST-${test.name}-${test.methods}"/>
1532
<test if:blank="${test.methods}" name="${test.name}" outfile="build/test/output/TEST-${test.name}"/>
1533
<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
1534
<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>
1535
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
1536
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
1537
<jvmarg value="-Dcassandra.skip_sync=true" />
1538
</testmacro>
1539
</target>
1540
1541
<!-- Use this with an FQDN for test class, and an optional csv list of methods like this:
1542
ant long-testsome -Dtest.name=org.apache.cassandra.cql3.ManyRowsTest
1543
ant long-testsome -Dtest.name=org.apache.cassandra.cql3.ManyRowsTest -Dtest.methods=testLargeCount
1544
-->
1545
<target name="long-testsome" depends="build-test" description="Execute specific long unit tests" >
1546
<testmacro inputdir="${test.long.src}" timeout="${test.long.timeout}">
1547
<test unless:blank="${test.methods}" name="${test.name}" methods="${test.methods}"/>
1548
<test if:blank="${test.methods}" name="${test.name}"/>
1549
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
1550
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
1551
</testmacro>
1552
</target>
1553
1554
<!-- Use this with an FQDN for test class, and an optional csv list of methods like this:
1555
ant burn-testsome -Dtest.name=org.apache.cassandra.utils.memory.LongBufferPoolTest
1556
ant burn-testsome -Dtest.name=org.apache.cassandra.utils.memory.LongBufferPoolTest -Dtest.methods=testPoolAllocateWithRecyclePartially
1557
-->
1558
<target name="burn-testsome" depends="build-test" description="Execute specific burn unit tests" >
1559
<testmacro inputdir="${test.burn.src}" timeout="${test.burn.timeout}">
1560
<test unless:blank="${test.methods}" name="${test.name}" methods="${test.methods}"/>
1561
<test if:blank="${test.methods}" name="${test.name}"/>
1562
<jvmarg value="-Dlogback.configurationFile=test/conf/logback-burntest.xml"/>
1563
</testmacro>
1564
</target>
1565
1566
<target name="test-compression" depends="build-test,stress-build" description="Execute unit tests with sstable compression enabled">
1567
<path id="all-test-classes-path">
1568
<fileset dir="${test.unit.src}" includes="**/${test.name}.java" />
1569
<fileset dir="${test.distributed.src}" includes="**/${test.name}.java" />
1570
</path>
1571
<property name="all-test-classes" refid="all-test-classes-path"/>
1572
<testhelper testdelegate="testlist-compression" />
1573
</target>
1574
1575
<target name="test-cdc" depends="build-test" description="Execute unit tests with change-data-capture enabled">
1576
<path id="all-test-classes-path">
1577
<fileset dir="${test.unit.src}" includes="**/${test.name}.java" />
1578
</path>
1579
<property name="all-test-classes" refid="all-test-classes-path"/>
1580
<testhelper testdelegate="testlist-cdc" />
1581
</target>
1582
1583
<target name="test-system-keyspace-directory" depends="build-test" description="Execute unit tests with a system keyspaces directory configured">
1584
<path id="all-test-classes-path">
1585
<fileset dir="${test.unit.src}" includes="**/${test.name}.java" />
1586
</path>
1587
<property name="all-test-classes" refid="all-test-classes-path"/>
1588
<testhelper testdelegate="testlist-system-keyspace-directory" />
1589
</target>
1590
1591
<target name="msg-ser-gen-test" depends="build-test" description="Generates message serializations">
1592
<testmacro inputdir="${test.unit.src}"
1593
timeout="${test.timeout}" filter="**/SerializationsTest.java">
1594
<jvmarg value="-Dcassandra.test-serialization-writes=True"/>
1595
</testmacro>
1596
</target>
1597
1598
<target name="msg-ser-test" depends="build-test" description="Tests message serializations">
1599
<testmacro inputdir="${test.unit.src}" timeout="${test.timeout}"
1600
filter="**/SerializationsTest.java"/>
1601
</target>
1602
1603
<target name="msg-ser-test-7" depends="build-test" description="Generates message serializations">
1604
<testmacro inputdir="${test.unit.src}"
1605
timeout="${test.timeout}" filter="**/SerializationsTest.java">
1606
<jvmarg value="-Dcassandra.version=0.7"/>
1607
</testmacro>
1608
</target>
1609
1610
<target name="msg-ser-test-10" depends="build-test" description="Tests message serializations on 1.0 messages">
1611
<testmacro inputdir="${test.unit.src}"
1612
timeout="${test.timeout}" filter="**/SerializationsTest.java">
1613
<jvmarg value="-Dcassandra.version=1.0"/>
1614
</testmacro>
1615
</target>
1616
1617
<target name="test-burn" depends="build-test" description="Execute functional tests">
1618
<testmacro inputdir="${test.burn.src}"
1619
timeout="${test.burn.timeout}">
1620
</testmacro>
1621
</target>
1622
1623
<target name="long-test" depends="build-test" description="Execute functional tests">
1624
<testmacro inputdir="${test.long.src}"
1625
timeout="${test.long.timeout}">
1626
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
1627
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
1628
</testmacro>
1629
</target>
1630
1631
<target name="test-memory" depends="build-test" description="Execute functional tests">
1632
<testmacro inputdir="${test.memory.src}"
1633
timeout="${test.memory.timeout}">
1634
<jvmarg value="-javaagent:${build.dir}/test/lib/jars/java-allocation-instrumenter-${allocation-instrumenter.version}.jar"/>
1635
</testmacro>
1636
</target>
1637
1638
<target name="cql-test" depends="build-test" description="Execute CQL tests">
1639
<sequential>
1640
<echo message="running CQL tests"/>
1641
<mkdir dir="${build.test.dir}/cassandra"/>
1642
<mkdir dir="${build.test.dir}/output"/>
1643
<junit fork="on" forkmode="once" failureproperty="testfailed" maxmemory="1024m" timeout="${test.timeout}">
1644
<formatter type="brief" usefile="false"/>
1645
<jvmarg value="-Dstorage-config=${test.conf}"/>
1646
<jvmarg value="-Djava.awt.headless=true"/>
1647
<jvmarg value="-javaagent:${build.lib}/jamm-${jamm.version}.jar" />
1648
<jvmarg value="-ea"/>
1649
<jvmarg value="-Xss256k"/>
1650
<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>
1651
<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>
1652
<jvmarg value="-Dcassandra.skip_sync=true" />
1653
<classpath>
1654
<path refid="cassandra.classpath.test" />
1655
<pathelement location="${test.classes}"/>
1656
<pathelement location="${test.conf}"/>
1657
<fileset dir="${test.lib}">
1658
<include name="**/*.jar" />
1659
</fileset>
1660
</classpath>
1661
<batchtest todir="${build.test.dir}/output">
1662
<fileset dir="${test.unit.src}" includes="**/cql3/*Test.java">
1663
<contains text="CQLTester" casesensitive="yes"/>
1664
</fileset>
1665
</batchtest>
1666
</junit>
1667
<fail message="Some CQL test(s) failed.">
1668
<condition>
1669
<and>
1670
<isset property="testfailed"/>
1671
<not>
1672
<isset property="ant.test.failure.ignore"/>
1673
</not>
1674
</and>
1675
</condition>
1676
</fail>
1677
</sequential>
1678
</target>
1679
1680
<!-- Use this with an simple class name for test class, and an optional csv list of methods like this:
1681
ant cql-test-some -Dtest.name=ListsTest
1682
ant cql-test-some -Dtest.name=ListsTest -Dtest.methods=testPrecisionTime_getNext_simple
1683
-->
1684
<target name="cql-test-some" depends="build-test" description="Execute specific CQL tests" >
1685
<sequential>
1686
<echo message="running ${test.methods} tests from ${test.name}"/>
1687
<mkdir dir="${build.test.dir}/cassandra"/>
1688
<mkdir dir="${build.test.dir}/output"/>
1689
<junit fork="on" forkmode="once" failureproperty="testfailed" maxmemory="1024m" timeout="${test.timeout}">
1690
<formatter type="brief" usefile="false"/>
1691
<jvmarg value="-Dstorage-config=${test.conf}"/>
1692
<jvmarg value="-Djava.awt.headless=true"/>
1693
<jvmarg value="-javaagent:${build.lib}/jamm-${jamm.version}.jar" />
1694
<jvmarg value="-ea"/>
1695
<jvmarg value="-Xss256k"/>
1696
<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>
1697
<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>
1698
<jvmarg value="-Dcassandra.skip_sync=true" />
1699
<classpath>
1700
<path refid="cassandra.classpath.test" />
1701
<pathelement location="${test.classes}"/>
1702
<pathelement location="${test.conf}"/>
1703
<fileset dir="${test.lib}">
1704
<include name="**/*.jar" />
1705
</fileset>
1706
</classpath>
1707
<test unless:blank="${test.methods}" name="org.apache.cassandra.cql3.${test.name}" methods="${test.methods}" todir="${build.test.dir}/output"/>
1708
<test if:blank="${test.methods}" name="org.apache.cassandra.cql3.${test.name}" todir="${build.test.dir}/output"/>
1709
</junit>
1710
</sequential>
1711
</target>
1712
1713
<!-- Use JaCoCo ant extension without needing externally saved lib -->
1714
<target name="jacoco-init" depends="resolver-init">
1715
<typedef uri="antlib:org.jacoco.ant" classpathref="jacocoant.classpath"/>
1716
</target>
1717
1718
<target name="jacoco-merge" depends="jacoco-init">
1719
<jacoco:merge destfile="${jacoco.finalexecfile}" xmlns:jacoco="antlib:org.jacoco.ant">
1720
<fileset dir="${jacoco.export.dir}" includes="*.exec,**/*.exec"/>
1721
</jacoco:merge>
1722
</target>
1723
1724
<target name="jacoco-report" depends="jacoco-merge">
1725
<jacoco:report xmlns:jacoco="antlib:org.jacoco.ant">
1726
<executiondata>
1727
<file file="${jacoco.finalexecfile}" />
1728
</executiondata>
1729
<structure name="JaCoCo Cassandara Coverage Report">
1730
<classfiles>
1731
<fileset dir="${build.classes.main}">
1732
<include name="**/*.class"/>
1733
</fileset>
1734
</classfiles>
1735
<sourcefiles encoding="UTF-8">
1736
<dirset dir="${build.src}">
1737
<include name="java"/>
1738
<include name="gen-java"/>
1739
</dirset>
1740
</sourcefiles>
1741
</structure>
1742
<!-- to produce reports in different formats. -->
1743
<html destdir="${jacoco.export.dir}" />
1744
<csv destfile="${jacoco.export.dir}/report.csv" />
1745
<xml destfile="${jacoco.export.dir}/report.xml" />
1746
</jacoco:report>
1747
</target>
1748
1749
<target name="jacoco-cleanup" description="Destroy JaCoCo exec data and reports">
1750
<delete file="${jacoco.partialexecfile}"/>
1751
<delete dir="${jacoco.export.dir}"/>
1752
</target>
1753
1754
<target name="javadoc" depends="build" description="Create javadoc" unless="no-javadoc">
1755
<create-javadoc destdir="${javadoc.dir}">
1756
<filesets>
1757
<fileset dir="${build.src.java}" defaultexcludes="yes">
1758
<include name="org/apache/**/*.java"/>
1759
</fileset>
1760
</filesets>
1761
</create-javadoc>
1762
</target>
1763
1764
<!-- Run tests and reports errors and generates a junit report after -->
1765
<macrodef name="testmacro">
1766
<attribute name="inputdir" />
1767
<attribute name="timeout" default="${test.timeout}" />
1768
<attribute name="forkmode" default="perTest"/>
1769
<attribute name="showoutput" default="true"/>
1770
<element name="optjvmargs" implicit="true" optional="true" />
1771
<attribute name="filter" default="**/${test.name}.java"/>
1772
<attribute name="exclude" default="" />
1773
<attribute name="filelist" default="" />
1774
<attribute name="testtag" default=""/>
1775
1776
<sequential>
1777
<testmacrohelper inputdir="@{inputdir}" timeout="@{timeout}"
1778
forkmode="@{forkmode}" filter="@{filter}"
1779
exclude="@{exclude}" filelist="@{filelist}"
1780
testtag="@{testtag}" showoutput="false" >
1781
<optjvmargs/>
1782
</testmacrohelper>
1783
<fail message="Some test(s) failed.">
1784
<condition>
1785
<and>
1786
<isset property="testfailed"/>
1787
<not>
1788
<isset property="ant.test.failure.ignore"/>
1789
</not>
1790
</and>
1791
</condition>
1792
</fail>
1793
</sequential>
1794
</macrodef>
1795
1796
<target name="test" depends="eclipse-warnings,build-test" description="Test Runner">
1797
<path id="all-test-classes-path">
1798
<fileset dir="${test.unit.src}" includes="**/${test.name}.java" excludes="**/distributed/test/UpgradeTest*.java" />
1799
</path>
1800
<property name="all-test-classes" refid="all-test-classes-path"/>
1801
<testhelper testdelegate="testlist"/>
1802
</target>
1803
1804
<target name="generate-test-report" description="Generates JUnit's HTML report from results already in build/output">
1805
<junitreport todir="${build.test.dir}">
1806
<fileset dir="${build.test.dir}/output">
1807
<include name="**/TEST-*.xml"/>
1808
</fileset>
1809
<report format="frames" todir="${build.test.dir}/junitreport"/>
1810
</junitreport>
1811
</target>
1812
1813
<!-- run a list of tests as provided in -Dtest.classlistfile (or default of 'testnames.txt')
1814
The class list file should be one test class per line, with the path starting after test/unit
1815
e.g. org/apache/cassandra/hints/HintMessageTest.java -->
1816
<target name="testclasslist" depends="build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">
1817
<path id="all-test-classes-path">
1818
<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>
1819
</path>
1820
<property name="all-test-classes" refid="all-test-classes-path"/>
1821
<testhelper testdelegate="testlist"/>
1822
</target>
1823
<target name="testclasslist-compression" depends="build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">
1824
<path id="all-test-classes-path">
1825
<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>
1826
</path>
1827
<property name="all-test-classes" refid="all-test-classes-path"/>
1828
<testhelper testdelegate="testlist-compression"/>
1829
</target>
1830
<target name="testclasslist-cdc" depends="build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">
1831
<path id="all-test-classes-path">
1832
<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>
1833
</path>
1834
<property name="all-test-classes" refid="all-test-classes-path"/>
1835
<testhelper testdelegate="testlist-cdc"/>
1836
</target>
1837
<target name="testclasslist-system-keyspace-directory" depends="build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">
1838
<path id="all-test-classes-path">
1839
<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>
1840
</path>
1841
<property name="all-test-classes" refid="all-test-classes-path"/>
1842
<testhelper testdelegate="testlist-system-keyspace-directory"/>
1843
</target>
1844
1845
<!-- Build a self-contained jar for e.g. remote execution; not currently used for running burn tests with this build script -->
1846
<target name="burn-test-jar" depends="build-test, build" description="Create dtest-compatible jar, including all dependencies">
1847
<jar jarfile="${build.dir}/burntest.jar">
1848
<zipgroupfileset dir="${build.lib}" includes="*.jar" excludes="META-INF/*.SF"/>
1849
<fileset dir="${build.classes.main}"/>
1850
<fileset dir="${test.classes}"/>
1851
<fileset dir="${test.conf}" excludes="logback*.xml"/>
1852
<fileset dir="${basedir}/conf" includes="logback*.xml"/>
1853
<zipgroupfileset dir="${build.dir.lib}/jars">
1854
<include name="junit*.jar"/>
1855
</zipgroupfileset>
1856
</jar>
1857
</target>
1858
1859
<target name="dtest-jar" depends="build-test, build" description="Create dtest-compatible jar, including all dependencies">
1860
<jar jarfile="${build.dir}/dtest-${base.version}.jar">
1861
<zipgroupfileset dir="${build.lib}" includes="*.jar" excludes="META-INF/*.SF"/>
1862
<zipgroupfileset dir="${build.dir.lib}/jars" includes="javassist-*.jar,reflections-*.jar" excludes="META-INF/*.SF"/>
1863
<fileset dir="${build.classes.main}"/>
1864
<fileset dir="${test.classes}"/>
1865
<fileset dir="${test.conf}" />
1866
</jar>
1867
</target>
1868
1869
<target name="test-jvm-dtest" depends="build-test" description="Execute in-jvm dtests">
1870
<testmacro inputdir="${test.distributed.src}" timeout="${test.distributed.timeout}" forkmode="once" showoutput="true" filter="**/test/*Test.java">
1871
<jvmarg value="-Dlogback.configurationFile=test/conf/logback-dtest.xml"/>
1872
<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>
1873
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
1874
<jvmarg value="-Dcassandra.skip_sync=true" />
1875
</testmacro>
1876
</target>
1877
1878
<target name="test-jvm-upgrade-dtest" depends="build-test" description="Execute in-jvm dtests">
1879
<testmacro inputdir="${test.distributed.src}" timeout="${test.distributed.timeout}" forkmode="once" showoutput="true" filter="**/upgrade/*Test.java">
1880
<jvmarg value="-Dlogback.configurationFile=test/conf/logback-dtest.xml"/>
1881
<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>
1882
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
1883
<jvmarg value="-Dcassandra.skip_sync=true" />
1884
</testmacro>
1885
</target>
1886
1887
<!-- Use this with an FQDN for test class, and an optional csv list of methods like this:
1888
ant test-jvm-dtest-some -Dtest.name=org.apache.cassandra.distributed.test.ResourceLeakTest -Dtest.methods=looperTest
1889
-->
1890
<target name="test-jvm-dtest-some" depends="build-test" description="Execute some in-jvm dtests">
1891
<testmacro inputdir="${test.distributed.src}" timeout="${test.distributed.timeout}" forkmode="once" showoutput="true">
1892
<test unless:blank="${test.methods}" name="${test.name}" methods="${test.methods}" outfile="build/test/output/TEST-${test.name}-${test.methods}"/>
1893
<test if:blank="${test.methods}" name="${test.name}" outfile="build/test/output/TEST-${test.name}"/>
1894
<jvmarg value="-Dlogback.configurationFile=test/conf/logback-dtest.xml"/>
1895
<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>
1896
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
1897
<jvmarg value="-Dcassandra.skip_sync=true" />
1898
</testmacro>
1899
</target>
1900
1901
<!-- run microbenchmarks suite -->
1902
<target name="microbench" depends="build-jmh">
1903
<java classname="org.openjdk.jmh.Main"
1904
fork="true"
1905
failonerror="true">
1906
<classpath>
1907
<path refid="cassandra.classpath.test" />
1908
<pathelement location="${test.classes}"/>
1909
<pathelement location="${test.conf}"/>
1910
<fileset dir="${test.lib}">
1911
<include name="**/*.jar" />
1912
</fileset>
1913
</classpath>
1914
<arg value="-foe"/>
1915
<arg value="true"/>
1916
<arg value="-rf"/>
1917
<arg value="json"/>
1918
<arg value="-rff"/>
1919
<arg value="${build.test.dir}/jmh-result.json"/>
1920
<arg value="-v"/>
1921
<arg value="EXTRA"/>
1922
1923
<!-- Broken: ZeroCopyStreamingBench,MutationBench,FastThreadLocalBench (FIXME) -->
1924
<arg value="-e"/><arg value="ZeroCopyStreamingBench|MutationBench|FastThreadLocalBench"/>
1925
1926
<arg value=".*microbench.*${benchmark.name}"/>
1927
</java>
1928
</target>
1929
1930
<!-- run arbitrary mains in tests, for example to run the long running memory tests with lots of memory pressure
1931
ant run-main -Dmainclass=org.apache.cassandra.utils.memory.LongBufferPoolTest -Dvmargs="-Xmx30m -XX:-UseGCOverheadLimit"
1932
-->
1933
<target name="run-main" depends="build-test">
1934
<property name="mainclass" value="" />
1935
<property name="vmargs" value="" />
1936
<property name="args" value="" />
1937
<java classname="${mainclass}"
1938
fork="true"
1939
failonerror="true">
1940
<jvmarg value="-server" />
1941
<jvmarg value="-ea" />
1942
<jvmarg line="${vmargs}" />
1943
<arg line="${args}" />
1944
<classpath>
1945
<path refid="cassandra.classpath" />
1946
<pathelement location="${test.classes}"/>
1947
<pathelement location="${test.conf}"/>
1948
<fileset dir="${test.lib}">
1949
<include name="**/*.jar" />
1950
</fileset>
1951
</classpath>
1952
</java>
1953
</target>
1954
1955
<target name="_maybe_update_idea_to_java11" if="java.version.11">
1956
<replace file="${eclipse.project.name}.iml" token="JDK_1_8" value="JDK_11"/>
1957
<replace file=".idea/misc.xml" token="JDK_1_8" value="JDK_11"/>
1958
<replace file=".idea/misc.xml" token="1.8" value="11"/>
1959
<replaceregexp file=".idea/workspace.xml"
1960
match="name=&quot;VM_PARAMETERS&quot; value=&quot;(.*)&quot;"
1961
replace="name=&quot;VM_PARAMETERS&quot; value=&quot;\1 ${java11-jvmargs}&quot;"
1962
byline="true"/>
1963
1964
<echo file=".idea/compiler.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
1965
<project version="4">
1966
<component name="JavacSettings">
1967
<option name="ADDITIONAL_OPTIONS_STRING" value="--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED" />
1968
</component>
1969
</project>]]></echo>
1970
</target>
1971
1972
<!-- Generate IDEA project description files -->
1973
<target name="generate-idea-files" depends="init,maven-ant-tasks-init,resolver-dist-lib,gen-cql3-grammar,generate-jflex-java,createVersionPropFile" description="Generate IDEA files">
1974
<mkdir dir=".idea"/>
1975
<mkdir dir=".idea/libraries"/>
1976
<copy todir=".idea" overwrite="true">
1977
<fileset dir="ide/idea"/>
1978
</copy>
1979
<replace file=".idea/workspace.xml" token="trunk" value="${eclipse.project.name}"/>
1980
<copy tofile="${eclipse.project.name}.iml" file="ide/idea-iml-file.xml"/>
1981
<echo file=".idea/.name">Apache Cassandra ${eclipse.project.name}</echo>
1982
<echo file=".idea/modules.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
1983
<project version="4">
1984
<component name="ProjectModuleManager">
1985
<modules>
1986
<module fileurl="file://$PROJECT_DIR$/]]>${eclipse.project.name}<![CDATA[.iml" filepath="$PROJECT_DIR$/]]>${eclipse.project.name}<![CDATA[.iml" />
1987
</modules>
1988
</component>
1989
</project>]]></echo>
1990
<antcall target="_maybe_update_idea_to_java11"/>
1991
</target>
1992
1993
<!-- Generate Eclipse project description files -->
1994
<target name="generate-eclipse-files" depends="build-test" description="Generate eclipse files">
1995
<echo file=".project"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
1996
<projectDescription>
1997
<name>${eclipse.project.name}</name>
1998
<comment></comment>
1999
<projects>
2000
</projects>
2001
<buildSpec>
2002
<buildCommand>
2003
<name>org.eclipse.jdt.core.javabuilder</name>
2004
</buildCommand>
2005
</buildSpec>
2006
<natures>
2007
<nature>org.eclipse.jdt.core.javanature</nature>
2008
</natures>
2009
</projectDescription>]]>
2010
</echo>
2011
<echo file=".classpath"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
2012
<classpath>
2013
<classpathentry kind="src" path="src/java"/>
2014
<classpathentry kind="src" path="src/resources"/>
2015
<classpathentry kind="src" path="src/gen-java"/>
2016
<classpathentry kind="src" path="conf" including="hotspot_compiler"/>
2017
<classpathentry kind="src" output="build/test/classes" path="test/unit"/>
2018
<classpathentry kind="src" output="build/test/classes" path="test/long"/>
2019
<classpathentry kind="src" output="build/test/classes" path="test/distributed"/>
2020
<classpathentry kind="src" output="build/test/classes" path="test/resources" />
2021
<classpathentry kind="src" path="tools/stress/src"/>
2022
<classpathentry kind="src" path="tools/fqltool/src"/>
2023
<classpathentry kind="src" output="build/test/stress-classes" path="tools/stress/test/unit" />
2024
<classpathentry kind="src" output="build/test/fqltool-classes" path="tools/fqltool/test/unit" />
2025
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
2026
<classpathentry kind="output" path="build/classes/eclipse"/>
2027
<classpathentry kind="lib" path="test/conf"/>
2028
<classpathentry kind="lib" path="${java.home}/../lib/tools.jar"/>
2029
]]>
2030
</echo>
2031
<path id="eclipse-project-libs-path">
2032
<fileset dir="lib">
2033
<include name="**/*.jar" />
2034
</fileset>
2035
<fileset dir="build/lib/jars">
2036
<include name="**/*.jar" />
2037
</fileset>
2038
<fileset dir="build/test/lib/jars">
2039
<include name="**/*.jar" />
2040
</fileset>
2041
</path>
2042
<property name="eclipse-project-libs" refid="eclipse-project-libs-path"/>
2043
<script language="javascript">
2044
<classpath>
2045
<path refid="cassandra.classpath"/>
2046
<path refid="cassandra.classpath.test"/>
2047
</classpath>
2048
<![CDATA[
2049
var File = java.io.File;
2050
var FilenameUtils = Packages.org.apache.commons.io.FilenameUtils;
2051
jars = project.getProperty("eclipse-project-libs").split(project.getProperty("path.separator"));
2052
2053
cp = "";
2054
for (i=0; i< jars.length; i++) {
2055
srcjar = FilenameUtils.getBaseName(jars[i]) + '-sources.jar';
2056
srcdir = FilenameUtils.concat(project.getProperty("build.test.dir"), 'sources');
2057
srcfile = new File(FilenameUtils.concat(srcdir, srcjar));
2058
2059
cp += ' <classpathentry kind="lib" path="' + jars[i] + '"';
2060
if (srcfile.exists()) {
2061
cp += ' sourcepath="' + srcfile.getAbsolutePath() + '"';
2062
}
2063
cp += '/>\n';
2064
}
2065
2066
cp += '</classpath>';
2067
2068
echo = project.createTask("echo");
2069
echo.setMessage(cp);
2070
echo.setFile(new File(".classpath"));
2071
echo.setAppend(true);
2072
echo.perform();
2073
]]> </script>
2074
<mkdir dir=".settings" />
2075
</target>
2076
2077
<pathconvert property="eclipse.project.name">
2078
<path path="${basedir}" />
2079
<regexpmapper from="^.*/([^/]+)$$" to="\1" handledirsep="yes" />
2080
</pathconvert>
2081
2082
<!-- Clean Eclipse project description files -->
2083
<target name="clean-eclipse-files">
2084
<delete file=".project" />
2085
<delete file=".classpath" />
2086
<delete dir=".settings" />
2087
<delete dir=".externalToolBuilders" />
2088
<delete dir="build/eclipse-classes" />
2089
</target>
2090
2091
<!-- ECJ 4.6.1 in standalone mode does not work with JPMS, so we skip this target for Java 11 -->
2092
<target name="eclipse-warnings" depends="build, _assert_rat_output" description="Run eclipse compiler code analysis" if="java.version.8">
2093
<property name="ecj.log.dir" value="${build.dir}/ecj" />
2094
<property name="ecj.warnings.file" value="${ecj.log.dir}/eclipse_compiler_checks.txt"/>
2095
<mkdir dir="${ecj.log.dir}" />
2096
2097
<property name="ecj.properties" value="${basedir}/eclipse_compiler.properties" />
2098
2099
<echo message="Running Eclipse Code Analysis. Output logged to ${ecj.warnings.file}" />
2100
2101
<java
2102
jar="${build.dir.lib}/jars/ecj-${ecj.version}.jar"
2103
fork="true"
2104
failonerror="true"
2105
maxmemory="512m">
2106
<arg value="-source"/>
2107
<arg value="${source.version}" />
2108
<arg value="-target"/>
2109
<arg value="${target.version}" />
2110
<arg value="-d" />
2111
<arg value="none" />
2112
<arg value="-proc:none" />
2113
<arg value="-log" />
2114
<arg value="${ecj.warnings.file}" />
2115
<arg value="-properties" />
2116
<arg value="${ecj.properties}" />
2117
<arg value="-cp" />
2118
<arg value="${toString:cassandra.classpath}" />
2119
<arg value="${build.src.java}" />
2120
</java>
2121
</target>
2122
2123
2124
<!-- Installs artifacts to local Maven repository -->
2125
<target name="mvn-install"
2126
depends="maven-declare-dependencies,jar,sources-jar,javadoc-jar"
2127
description="Installs the artifacts in the Maven Local Repository">
2128
2129
<!-- the parent -->
2130
<install pomFile="${build.dir}/${final.name}-parent.pom"
2131
file="${build.dir}/${final.name}-parent.pom"
2132
packaging="pom"/>
2133
2134
<!-- the cassandra-all jar -->
2135
<install pomFile="${build.dir}/${final.name}.pom"
2136
file="${build.dir}/${final.name}.jar"/>
2137
<install pomFile="${build.dir}/${final.name}.pom"
2138
file="${build.dir}/${final.name}-sources.jar"
2139
classifier="sources"/>
2140
<install pomFile="${build.dir}/${final.name}.pom"
2141
file="${build.dir}/${final.name}-javadoc.jar"
2142
classifier="javadoc"/>
2143
</target>
2144
2145
<!-- Publish artifacts to remote Maven repository -->
2146
<target name="publish"
2147
depends="mvn-install,artifacts"
2148
description="Publishes the artifacts to the Maven repository">
2149
2150
<!-- the parent -->
2151
<deploy pomFile="${build.dir}/${final.name}-parent.pom"
2152
file="${build.dir}/${final.name}-parent.pom"
2153
packaging="pom"/>
2154
2155
<!-- the cassandra-all jar -->
2156
<deploy pomFile="${build.dir}/${final.name}.pom"
2157
file="${build.dir}/${final.name}.jar"/>
2158
<deploy pomFile="${build.dir}/${final.name}.pom"
2159
file="${build.dir}/${final.name}-sources.jar"
2160
classifier="sources"/>
2161
<deploy pomFile="${build.dir}/${final.name}.pom"
2162
file="${build.dir}/${final.name}-javadoc.jar"
2163
classifier="javadoc"/>
2164
2165
<!-- the distribution -->
2166
<sign-dist file="${build.dir}/${final.name}-bin.tar.gz" />
2167
<sign-dist file="${build.dir}/${final.name}-src.tar.gz" />
2168
2169
</target>
2170
2171
<import file="${basedir}/.build/build-resolver.xml"/>
2172
<import file="${basedir}/.build/build-rat.xml"/>
2173
<import file="${basedir}/.build/build-owasp.xml"/>
2174
</project>
2175
2176